GithubHelp home page GithubHelp logo

balistof / broadlink-thermostat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ralphm2004/broadlink-thermostat

0.0 0.0 0.0 41 KB

link broadlink thermostat with mqtt to openhab

License: GNU General Public License v3.0

Python 96.51% Shell 3.49%

broadlink-thermostat's Introduction

broadlink thermostat with mqtt and openhab

default.items

Number TS_Room        "Temperature Room  [%.1f °C]"    (Temperatur)
        { mqtt="<[mo:/broadlink/xxxxxx34ea34/room_temp:state:JS(number.js)]" }
Number TS_Room_Set    "Setpoint Room  [%.1f °C]"       (Temperatur)
        { mqtt="<[mo:/broadlink/xxxxxx34ea34/thermostat_temp:state:JS(number.js)], 
          >[mo:/broadlink/xxxxxx34ea34/cmd/set_temp:command:*:default]"}
Switch TS_Room_Activ  "Room is heating"                     (Temperatur)
        { mqtt="<[mo:/broadlink/xxxxxx34ea34/active:state:MAP(active.map)"}
Switch TS_Room_Mode   "Room Auto-Mode (ON/OFF)"             (Temperatur)
        { mqtt="<[mo:/broadlink/xxxxxx34ea34/auto_mode:state:MAP(active.map)],
          >[mo:/broadlink/xxxxxx34ea34/cmd/set_mode:command:*:MAP(active.map)]"}
Switch TS_Room_Power  "Room Power (ON/OFF)"                 (Temperatur)
        { mqtt="<[mo:/broadlink/xxxxxx34ea34/power:state:MAP(active.map)],
          >[mo:/broadlink/xxxxxx34ea34/cmd/set_power:command:*:MAP(active.map)]"}

default.sitemap

Text      item=TS_Room  labelcolor=[TS_Room_Activ==ON="red"]  valuecolor=[>22="orange",>17="green",>5="blue"]
Setpoint  item=TS_Room_Set minValue=5 maxValue=35 step=1
Switch    item=TS_Room_Activ
Switch    item=TS_Room_Mode
Switch    item=TS_Room_Power

default.rule

rule "heat_autm_on_TS_Room_Set"
when
  Time cron "0  0  6 ? * MON-FRI *" or
  Time cron "0  0  9 ? * SAT-SUN *" or
  Time cron "0 30 18 ? * MON-FRI *" or
  Time cron "0 30 18 ? * SAT-SUN *"
then
  TS_Room_Set.sendCommand(22)
end
rule "heat_autm_off_TS_Room_Set"
when
  Time cron "0 30  7 ? * MON-FRI *" or
  Time cron "0 30 10 ? * SAT-SUN *" or
  Time cron "0  0 20 ? * MON-FRI *" or
  Time cron "0  0 21 ? * SAT-SUN *"
then
  TS_Room_Set.sendCommand(19)
end

number.js

result = parseFloat(input.trim()).toFixed(2);

active.map

0=OFF
1=ON
OFF=0
ON=1
-=unknown

broadlink thermostat with mqtt and mosquitto_sub/mosquitto_pub

read from mqtt

mosquitto_sub -v -h mqtt -t '/broadlink/#'

/broadlink/xxxxxx34ea34/dayofweek 1
/broadlink/xxxxxx34ea34/remote_lock 0
/broadlink/xxxxxx34ea34/osv 42
/broadlink/xxxxxx34ea34/sec 36
/broadlink/xxxxxx34ea34/external_temp 0.0
/broadlink/xxxxxx34ea34/fre 0
/broadlink/xxxxxx34ea34/min 56
/broadlink/xxxxxx34ea34/unknown 0
/broadlink/xxxxxx34ea34/sensor 0
/broadlink/xxxxxx34ea34/loop_mode 1
/broadlink/xxxxxx34ea34/room_temp 14.5
/broadlink/xxxxxx34ea34/power 1
/broadlink/xxxxxx34ea34/thermostat_temp 5.0
/broadlink/xxxxxx34ea34/temp_manual 0
/broadlink/xxxxxx34ea34/room_temp_adj 0.0
/broadlink/xxxxxx34ea34/active 0
/broadlink/xxxxxx34ea34/poweron 0
/broadlink/xxxxxx34ea34/auto_mode 0
/broadlink/xxxxxx34ea34/svl 5
/broadlink/xxxxxx34ea34/hour 22
/broadlink/xxxxxx34ea34/svh 35
/broadlink/xxxxxx34ea34/dif 2
/broadlink/xxxxxx34ea34/schedule [[{"start_hour": 6, "temp": 20.0, "start_minute": 0}, {"start_hour": 8, "temp": 15.0, "start_minute": 0}, {"start_hour": 11, "temp": 15.0, "start_minute": 30}, {"start_hour": 12, "temp": 15.0, "start_minute": 30}, {"start_hour": 17, "temp": 22.0, "start_minute": 0}, {"start_hour": 22, "temp": 15.0, "start_minute": 0}], [{"start_hour": 8, "temp": 22.0, "start_minute": 0}, {"start_hour": 23, "temp": 15.0, "start_minute": 0}]]

set temperature for manual mode (also activates manual mode if currently in automatic)

mosquitto_pub -h 192.168.1.9 -t /broadlink/xxxxxx34ea34/cmd/set_temp -m '22'

set auto_mode = 1 for auto (scheduled/timed) mode, 0 for manual mode.

mosquitto_pub -h 192.168.1.9 -t /broadlink/xxxxxx34ea34/cmd/set_mode -m '0'

set device on(1) or off(0), does not deactivate Wifi connectivity

mosquitto_pub -h 192.168.1.9 -t /broadlink/xxxxxx34ea34/cmd/set_power -m '1'

set timer schedule, format is the same as you get from mosquitto_sub.

mosquitto_pub -h mqtt -t /broadlink/xxxxxx34ea34/cmd/set_schedule  -m '[[{"start_hour": 6, "temp": 20.0, "start_minute": 0}, {"start_hour": 8, "temp": 15.0, "start_minute": 0}, {"start_hour": 11, "temp": 15.0, "start_minute": 30}, {"start_hour": 12, "temp": 15.0, "start_minute": 30}, {"start_hour": 17, "temp": 22.0, "start_minute": 0}, {"start_hour": 22, "temp": 15.0, "start_minute": 0}], [{"start_hour": 8, "temp": 22.0, "start_minute": 0}, {"start_hour": 23, "temp": 15.0, "start_minute": 0}]]'

broadlink-thermostat's People

Contributors

ralphm2004 avatar christophfroeschl avatar balistof avatar fermentfan avatar scheilch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.