New to OH. Trying to set up thermostat and dimmer web interfaces

Hi. I’m coming from Vera and really like the ease of writing rules for OH. I’ve got all of my devices working but I am wondering how to go about setting up a web interface for my thermostat that is similar to this:

http://i.imgur.com/xHfoIWy.png

Right now I can display the current temperature, set points, thermostat mode and fan mode, but I can’t interact with them. I do have a rule set up that will raise/lower the temperature based on pressing buttons on a remote control, but I’d like to be able to do this on the web interface as well. Is there an easy way to do this?

Lastly, I have a dimmer for a lamp. On the Android app this shows up as a slider but doesn’t show any value associated with the slider. It would also be nice to have a discrete on/off button for the light in addition to the ability to increase/decrease the brightness. Here’s an example of this from Vera interface:

Can anyone tell me if either of these are possible? Many thanks!

Hi!

I don’t use Vera, but Zipabox instead, which has a very similar approach for thermostat control.

As I have learned in this link, there is no web Interface/UI kind of thing. You have to do it all by yourself with rules.

But as you said, you like working with rules… :slight_smile:

Not sure if this is what you intended to say, but it seems like you’re saying that there’s no way to directly control thermostat attributes (fan, mode, set point, etc.) from the classic UI, and instead you have to go with full automation.

You’re not forced to go into full automation. It’s fairly easy to set up what amounts to a virtual direct control panel:

(If that wasn’t your intent, apologies in advance!)

@TheKorn This is exactly what I am looking for. Can you share how you did this?

Sure, no problem!

I have a honeywell zwave thermostat, so starting with items…

// turned on ten-minute polling for these, because if a built-in schedule kicks it doesn't seem to update zwave...
Number LIVINGROOM_THERMOSTAT_HEAT_SETPOINT "Livingroom Thermostat Heating Set Point [%.1f F]" <heating2_small> (Group_Thermostat, Group_Persistence)  {zwave="40:0:command=THERMOSTAT_SETPOINT,setpoint_type=1,setpoint_scale=1,refresh_interval=600"}
Number LIVINGROOM_THERMOSTAT_COOL_SETPOINT "Livingroom Thermostat Cooling Set Point [%.1f F]" <thermometer_snowflake_small> (Group_Thermostat, Group_Persistence)  {zwave="40:0:command=THERMOSTAT_SETPOINT,setpoint_type=2,setpoint_scale=1,refresh_interval=600"}

// thermostat operating state indicates heating when heating.
//  thermostat operating state indicates idle when not doing anything.
// (i.e. thermostat operating state is what's happening right now)

Number LIVINGROOM_THERMOSTAT_OPERATING_STATE "Livingroom Thermostat State: [MAP(zwave_thermostat_operating_state.map):%s]" (Group_Thermostat, Group_Persistence)  {zwave="40:0:command=THERMOSTAT_OPERATING_STATE,refresh_interval=600"}

// thermostat mode indicates what mode the thermostat is in (heat on, cool on, etc),
//  not what it's actually doing right now.

Number LIVINGROOM_THERMOSTAT_MODE "Livingroom Thermostat Mode: [MAP(zwave_thermostat_mode.map):%s]" (Group_Thermostat, Group_Persistence)  {zwave="40:0:command=THERMOSTAT_MODE,refresh_interval=600"}
Number LIVINGROOM_THERMOSTAT_FAN_MODE "Livingroom Thermostat Fan Mode: [MAP(zwave_thermostat_fan_state.map):%d]"   (Group_Thermostat, Group_Persistences) { zwave="40:0:command=THERMOSTAT_FAN_MODE,refresh_interval=600" }

// this needs no polling; thermostat is more than happy to send updates all day long!
Number LIVINGROOM_THERMOSTAT_TEMPERATURE "Livingroom Thermostat Temperature: [%.1f F]" <temperature> (Group_Thermostat,Group_Temperature, Group_Persistence)  {zwave="40:0:command=SENSOR_MULTILEVEL,sensor_type=1"}

map files (transformations) (I think these are actually standard files, but a little more copy and paste doesn’t hurt…)

zwave_thermostat_fan_state_map:

0=Off
1=Running
2=Running High
6=Circulate
-=(No data yet)


zwave_thermostat_mode.map:

0=Off
1=Heat
2=Cool
3=Auto
4=Aux Heat
5=Resume
6=Fan Only
7=Furnace
8=Dry Air
9=Moist Air
10=Auto Changeover
11=Heat Econ
12=Cool Econ
13=Away
-=(No data yet)

zwave_thermostat_operating_state.map:

0=Idle
1=Heating
2=Cooling
3=Fan Only
4=Pending Heat
5=Pending Cool
6=Vent / Economizer
-=(No data yet)

And then the sitemap:

    Frame label="Living Room Thermostat" {
        Setpoint item=LIVINGROOM_THERMOSTAT_HEAT_SETPOINT icon="heating" minValue=60 maxValue=90 step=1.0
        Setpoint item=LIVINGROOM_THERMOSTAT_COOL_SETPOINT icon="cooling" minValue=60 maxValue=90 step=1.0
        Switch item=LIVINGROOM_THERMOSTAT_MODE label="Thermostat mode" mappings=[0="Off",1="Heat",2="Cool"]
        Switch item=LIVINGROOM_THERMOSTAT_FAN_MODE label="Thermostat fan mode" mappings=[0="Auto",1="On",6="Circulate"]
        Text item=LIVINGROOM_THERMOSTAT_TEMPERATURE
        Text item=LIVINGROOM_THERMOSTAT_OPERATING_STATE
    }

No rules needed at all! (Nothing is automated! :smiley: )

(I dislike automating thermostats, simply because one day 77F seems fine, the next 77F feels too warm. So I don’t even try.)

@TheKorn Got it! Looking good! Many thanks… RE: automating thermostat set points, I do it mainly to save money by not heating/cooling when we are away at work. I do agree about the same temp being too hot/cold depending on the day. I think this has a lot to do with the humidity here and am planning on trying to figure out a ‘feels like’ temperature for indoor temps by using the temperature and humidity readings.

Yeah, I think you’re on the right track. It’s over 80 here today and it feels like it’s barely breaking 70, mainly because the humidity is in the tank. (It’s nice!) I have a similar thing on my list of to-dos, but it’s wayyyyyyyyyy down on the priority list. So if you get something reasonable hacked together please do share! :wink:

That’s not hard to do as well… Define the item twice – once as a dimmer and once as a virtual switch that manipulates it:

Dimmer PINBALL_ALLEY_RED "LED Red [%d %%]" (Group_Dimmers, Group_Pinball_Alley, Group_Persistence)  {zwave="30:2:command=SWITCH_MULTILEVEL,restore_last_value=true"}
Switch PINBALL_ALLEY_RED_SWITCH "LED Red Slam Switch" (Group_Pinball_Alley, Group_Persistence)

…and the rules…

rule "pinball alley red switch on"
when
    Item PINBALL_ALLEY_RED_SWITCH changed to ON
then
    sendCommand(PINBALL_ALLEY_RED,100)
end

rule "pinball alley red switch off"
when
    Item PINBALL_ALLEY_RED_SWITCH changed to OFF
then
    sendCommand(PINBALL_ALLEY_RED,0)
end

Now you have your dimmer control, and a slam switch as well!


Here’s a better version of the rules, but requires persistence:

rule "pinball alley red switch on"
when
    Item PINBALL_ALLEY_RED_SWITCH changed to ON
then
    {
        if (!PINBALL_ALLEY_RED.changedSince(now.minusSeconds(1)))
            sendCommand(PINBALL_ALLEY_RED,100)    
    }
end

rule "pinball alley red switch off"
when
    Item PINBALL_ALLEY_RED_SWITCH changed to OFF
then
    {
        if (!PINBALL_ALLEY_RED.changedSince(now.minusSeconds(1)))
            sendCommand(PINBALL_ALLEY_RED,0)
    }
end

rule "pinball alley red dimmer changed"
when
    Item PINBALL_ALLEY_RED changed
then
    {
        if (PINBALL_ALLEY_RED.state > 2)
            postUpdate (PINBALL_ALLEY_RED_SWITCH, ON)
        else
            postUpdate (PINBALL_ALLEY_RED_SWITCH, OFF)        
    }
end