ralphm2004 / broadlink-thermostat

link broadlink thermostat with mqtt to openhab
GNU General Public License v3.0
35 stars 15 forks source link

Examples for new functions #2

Closed JueFri closed 6 years ago

JueFri commented 6 years ago

Hi First of all i would like to say thank you for your excellent work and for your willingness to share this work.

Could you please extend the openhab items file with new items for the new functions in the README.MD file. My MQTT knowledge is very limited so it would be great if you could add them.

best regards Jürgen

kompio commented 6 years ago

Is it possible that the script change my original schedule setting , loop 1234567 --> 12345,67 ? Thank you for good work !

ralphm2004 commented 6 years ago

@JueFri I added more example items @kompio loop_mode was set to 0 by default, now it is a option in the config file

kompio commented 6 years ago

Thank You, It works, but if I ran a script, all thermostats changed from automatic to manual with higher temperature and all unlock if were lock

JueFri commented 6 years ago

@ralphm2004 Thank you very much for your quick response and for your support.

For the TS_Room_Mode item i added two addtional MQTT outbound messages to switch to auto or manual mode.

Switch TS_Room_Mode "Room Auto-Mode (ON/OFF)" (Temperatur) { mqtt="<[mo:/broadlink/xxxxxx34ea34/auto_mode:state:MAP(active.map)],

[mo:/broadlink/xxxxxx34ea34/cmd/switch_to_auto:command:ON:1], [mo:/broadlink/xxxxxx34ea34/cmd/switch_to_manual:command:OFF:0]" }

Maybe it is useful for someone. best regards Jürgen

kompio commented 6 years ago

All works now, but i don't use openhab and i would like to add automatic/manual funcion in config file without use mqtt if is it possible (I have 14 thermostat in my house ;]). Thank You

JueFri commented 6 years ago

@ralphm2004 Do you have an item example to get and set the weekday and weekend schedules ? All my attempts have failed so far.

Thank you for your patience Jürgen

kompio commented 6 years ago

For example on my thermostat I set Loop: 1234567, Period 1: 1:00 - 23C 6:30 - 15C Period 2,3,4,5,6 - 15C And Automatic. If I stop and start Your Script, The termostat changed form Automatic to manual him self.

ralphm2004 commented 6 years ago

@kompio auto_mode is now a config option

kompio commented 6 years ago

All works. Thank You

ralphm2004 commented 6 years ago

@JueFri I changed the script an added examples with mosquitto_sub/mosquitto_pub

JueFri commented 6 years ago

@ralphm2004 Thank you very much for providing the weekday and weekend schedules. Now i can start to split the array into single items via jsonpath transformation.

best regards Jürgen

kompio commented 6 years ago

my Log: pi@orangepiplus:$ mosquitto_sub -v -h localhost -t '/broadlink/xxxxxx34ea34/#' /broadlink/xxxxxx34ea34/dayofweek 3 /broadlink/xxxxxx34ea34/remote_lock 1 /broadlink/xxxxxx34ea34/osv 42 /broadlink/xxxxxx34ea34/sec 16 /broadlink/xxxxxx34ea34/external_temp 0.0 /broadlink/xxxxxx34ea34/fre 1 /broadlink/xxxxxx34ea34/min 0 /broadlink/xxxxxx34ea34/unknown 0 /broadlink/xxxxxx34ea34/sensor 0 /broadlink/xxxxxx34ea34/loop_mode 3 /broadlink/xxxxxx34ea34/room_temp 19.5 /broadlink/xxxxxx34ea34/power 1 /broadlink/xxxxxx34ea34/thermostat_temp 15.0 /broadlink/xxxxxx34ea34/temp_manual 0 /broadlink/xxxxxx34ea34/room_temp_adj 32765.5 /broadlink/xxxxxx34ea34/active 0 /broadlink/xxxxxx34ea34/poweron 1 /broadlink/xxxxxx34ea34/auto_mode 3 /broadlink/xxxxxx34ea34/svl 5 /broadlink/xxxxxx34ea34/hour 22 /broadlink/xxxxxx34ea34/svh 35 /broadlink/xxxxxx34ea34/dif 2

i don't have : /broadlink/xxxxxx34ea34/schedule in my case auto_mode is 3 in automatic mode

ralphm2004 commented 6 years ago

@kompio can you pulled the latest version and post the log?

kompio commented 6 years ago

pi@orangepiplus:/opt/broadlink-thermostat$ mosquitto_sub -v -h localhost -t '/broadlink/xxxxxx34ea34/#' /broadlink/xxxxxx34ea34/dayofweek 5 /broadlink/xxxxxx34ea34/remote_lock 1 /broadlink/xxxxxx34ea34/osv 42 /broadlink/xxxxxx34ea34/sec 39 /broadlink/xxxxxx34ea34/external_temp 0.0 /broadlink/xxxxxx34ea34/fre 1 /broadlink/xxxxxx34ea34/min 40 /broadlink/xxxxxx34ea34/unknown 0 /broadlink/xxxxxx34ea34/sensor 0 /broadlink/xxxxxx34ea34/loop_mode 3 /broadlink/xxxxxx34ea34/room_temp 20.0 /broadlink/xxxxxx34ea34/power 1 /broadlink/xxxxxx34ea34/thermostat_temp 15.0 /broadlink/xxxxxx34ea34/temp_manual 0 /broadlink/xxxxxx34ea34/room_temp_adj 32765.5 /broadlink/xxxxxx34ea34/active 0 /broadlink/xxxxxx34ea34/poweron 1 /broadlink/xxxxxx34ea34/weekend [{"start_hour": 8, "temp": 21.0, "start_minute": 0}, {"start_hour": 23, "temp": 15.0, "start_minute": 0}] /broadlink/xxxxxx34ea34/auto_mode 1 /broadlink/xxxxxx34ea34/svl 5 /broadlink/xxxxxx34ea34/hour 21 /broadlink/xxxxxx34ea34/svh 35 /broadlink/xxxxxx34ea34/dif 2 /broadlink/xxxxxx34ea34/weekday [{"start_hour": 1, "temp": 23.0, "start_minute": 0}, {"start_hour": 6, "temp": 15.0, "start_minute": 30}, {"start_hour": 10, "temp": 15.0, "start_minute": 0}, {"start_hour": 14, "temp": 15.0, "start_minute": 0}, {"start_hour": 16, "temp": 15.0, "start_minute": 30}, {"start_hour": 22, "temp": 15.0, "start_minute": 0}] /broadlink/xxxxxx34ea34/schedule [[{"start_hour": 1, "temp": 23.0, "start_minute": 0}, {"start_hour": 6, "temp": 15.0, "start_minute": 30}, {"start_hour": 10, "temp": 15.0, "start_minute": 0}, {"start_hour": 14, "temp": 15.0, "start_minute": 0}, {"start_hour": 16, "temp": 15.0, "start_minute": 30}, {"start_hour": 22, "temp": 15.0, "start_minute": 0}], [{"start_hour": 8, "temp": 21.0, "start_minute": 0}, {"start_hour": 23, "temp": 15.0, "start_minute": 0}]]

Works

Thank You

JueFri commented 6 years ago

@ralphm2004 Based on your examples i am now able to subscribe and publish most of the thermostat parameters via openhab or mosquitto_sub / mosquitto_pub i have no idea how to "set_mode" for loop_mode.

"set_mode" in your script has the two parameters auto_mode and loop_mode and i have no idea how the syntax is for both parameters in one mosquitto_pub call. "set_mode" for auto_mode alone working fine with mosquitt_pub -u ... -P ... -t /broadlink/......34ea34/cmd/set_mode -m '1'

Could you please provide an example for "set_mode" for auto_mode and loop_mode in one mosquitto_pub ?

best regards Jürgen