XBOS Docs
Search…
Thermostat
Interface: i.xbos.thermostat
Description: Standard XBOS thermostat interface
PONUM: 2.1.1.0

Properties

Name
Type
Description
Units
Required
cooling_setpoint
double
Current cooling setpoint
Fahrenheit
true
enabled_cool_stages
integer
The number of cooling stages currently enabled for the thermostat
stages
false
enabled_heat_stages
integer
The number of heating stages currently enabled for the thermostat
stages
false
fan_mode
integer
Fan mode of the thermostat
1 = auto, 2 = on, 3 = schedule/auto
true
fan_state
boolean
Fan state of the thermostat
on/off
false
heating_setpoint
double
Current heating setpoint
Fahrenheit
true
mode
integer
The current operating policy of the thermostat
mode
true
override
boolean
Override state of the thermostat. If the thermostat is in override mode, it will not follow its programmed schedule.
on/off
true
relative_humidity
double
Current relative humidity reading at the thermostat
Percent
false
state
integer
The current state of the thermostat
state
true
temperature
double
Current temperature reading at the thermostat
Fahrenheit
true
time
integer
nanoseconds since the Unix epoch
ns
false

Signals

    info:
      temperature
      relative_humidity
      heating_setpoint
      cooling_setpoint
      override
      fan_state
      fan_mode
      mode
      state
      enabled_heat_stages
      enabled_cool_stages
      time

Slots

    setpoints:
      heating_setpoint
      cooling_setpoint
    stages:
      enabled_heat_stages
      enabled_cool_stages
    state:
      heating_setpoint
      cooling_setpoint
      override
      mode
      fan_mode

Interfacing in Go

1
package main
2
3
import (
4
"fmt"
5
bw2 "gopkg.in/immesys/bw2bind.v5"
6
)
7
8
func main() {
9
client := bw2.ConnectOrExit("")
10
client.OverrideAutoChainTo(true)
11
client.SetEntityFromEnvironOrExit()
12
13
base_uri := "Thermostat uri goes here ending in i.xbos.thermostat"
14
15
// subscribe
16
type signal struct {
17
Temperature float64 `msgpack:"temperature"`
18
Relative_humidity float64 `msgpack:"relative_humidity"`
19
Heating_setpoint float64 `msgpack:"heating_setpoint"`
20
Cooling_setpoint float64 `msgpack:"cooling_setpoint"`
21
Override bool `msgpack:"override"`
22
Fan_state bool `msgpack:"fan_state"`
23
Fan_mode int64 `msgpack:"fan_mode"`
24
Mode int64 `msgpack:"mode"`
25
State int64 `msgpack:"state"`
26
Enabled_heat_stages int64 `msgpack:"enabled_heat_stages"`
27
Enabled_cool_stages int64 `msgpack:"enabled_cool_stages"`
28
Time int64 `msgpack:"time"`
29
}
30
c, err := client.Subscribe(&bw2.SubscribeParams{
31
URI: base_uri + "/signal/info",
32
})
33
if err != nil {
34
panic(err)
35
}
36
37
for msg := range c {
38
var current_state signal
39
po := msg.GetOnePODF("2.1.1.0/32")
40
err := po.(bw2.MsgPackPayloadObject).ValueInto(&current_state)
41
if err != nil {
42
fmt.Println(err)
43
} else {
44
fmt.Println(current_state)
45
}
46
}
47
}
Copied!

Interfacing in Python

1
import time
2
import msgpack
3
4
from bw2python.bwtypes import PayloadObject
5
from bw2python.client import Client
6
7
bw_client = Client()
8
bw_client.setEntityFromEnviron()
9
bw_client.overrideAutoChainTo(True)
10
11
def onMessage(bw_message):
12
for po in bw_message.payload_objects:
13
if po.type_dotted == (2,1,1,0):
14
print msgpack.unpackb(po.content)
15
16
bw_client.subscribe("Thermostat uri ending in i.xbos.thermostat/signal/info", onMessage)
17
18
print "Subscribing. Ctrl-C to quit."
19
while True:
20
time.sleep(10000)
Copied!
Last modified 1yr ago