Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config option loop_mode does not work as expected #3

Open
JueFri opened this issue Mar 23, 2018 · 3 comments
Open

config option loop_mode does not work as expected #3

JueFri opened this issue Mar 23, 2018 · 3 comments

Comments

@JueFri
Copy link

JueFri commented Mar 23, 2018

@ralphm2004

After starting broadlink-thermostat.py as a service the variable loop_mode of a device has not the value of the config option loop_mode of broadlink-thermostat.conf.

broadlink-thermostat.conf:

...
# loop_mode refers to index in { "12345,67" , "123456,7 , "1234567" }
# E.G. loop_mode 2 means very day (including Sat and Sun) follows the weekday schedule
loop_mode = 0
...

broadlink-thermostat.py output:

[09:28:52] openhabian@raspi3:~$ sudo journalctl -f -u broadlink
-- Logs begin at Fri 2018-03-23 08:47:15 CET. --
Mar 23 09:27:20 raspi3 python[5417]: 888c9b34ea34 room_temp 21.5
Mar 23 09:27:28 raspi3 python[5417]: 9d779b34ea34 room_temp 20.0
Mar 23 09:27:29 raspi3 python[5417]: ce889b34ea34 room_temp 21.5
Mar 23 09:27:30 raspi3 python[5417]: 888c9b34ea34 room_temp 21.0
Mar 23 09:27:38 raspi3 python[5417]: 9d779b34ea34 room_temp 19.5
Mar 23 09:27:39 raspi3 systemd[1]: Stopping Broadlink MQTT bridge service...
Mar 23 09:27:39 raspi3 systemd[1]: Stopped Broadlink MQTT bridge service.
Mar 23 09:28:52 raspi3 systemd[1]: Starting Broadlink MQTT bridge service...
Mar 23 09:28:52 raspi3 systemd[1]: Started Broadlink MQTT bridge service.
Mar 23 09:28:53 raspi3 python[6001]: broadlink discover
Mar 23 09:29:13 raspi3 python[6001]: found: 192.168.0.191 9d779b34ea34
Mar 23 09:29:13 raspi3 python[6001]: PID child 6024
Mar 23 09:29:13 raspi3 python[6001]: Hysen heating controller
Mar 23 09:29:13 raspi3 python[6001]: set time 9:29:13 5
Mar 23 09:29:15 raspi3 python[6001]: found: 192.168.0.168 ce889b34ea34
Mar 23 09:29:15 raspi3 python[6001]: PID child 6026
Mar 23 09:29:15 raspi3 python[6001]: Hysen heating controller
Mar 23 09:29:15 raspi3 python[6001]: set time 9:29:15 5
Mar 23 09:29:17 raspi3 python[6001]: found: 192.168.0.171 888c9b34ea34
Mar 23 09:29:17 raspi3 python[6001]: PID child 6028
Mar 23 09:29:17 raspi3 python[6001]: Hysen heating controller
Mar 23 09:29:17 raspi3 python[6001]: set time 9:29:17 5
Mar 23 09:29:23 raspi3 python[6001]: 9d779b34ea34 room_temp 19.5
Mar 23 09:29:25 raspi3 python[6001]: ce889b34ea34 room_temp 21.5
Mar 23 09:29:27 raspi3 python[6001]: 888c9b34ea34 room_temp 21.5
Mar 23 09:29:33 raspi3 python[6001]: 9d779b34ea34 room_temp 20.0
^C[09:29:34] openhabian@raspi3:~$

MQTT subscribe output:

[09:28:05] openhabian@raspi3:~$ sudo mosquitto_sub -v -u xxxxxx -P yyyyyy -t /broadlink/ce889b34ea34/#
[sudo] password for openhabian:
/broadlink/ce889b34ea34/dayofweek 5
/broadlink/ce889b34ea34/remote_lock 0
/broadlink/ce889b34ea34/osv 42
/broadlink/ce889b34ea34/sec 26
/broadlink/ce889b34ea34/external_temp 0.0
/broadlink/ce889b34ea34/fre 1
/broadlink/ce889b34ea34/min 29
/broadlink/ce889b34ea34/unknown 0
/broadlink/ce889b34ea34/sensor 0
/broadlink/ce889b34ea34/loop_mode 1
/broadlink/ce889b34ea34/room_temp 21.5
/broadlink/ce889b34ea34/power 1
/broadlink/ce889b34ea34/thermostat_temp 20.0
/broadlink/ce889b34ea34/temp_manual 0
/broadlink/ce889b34ea34/room_temp_adj 0.0
/broadlink/ce889b34ea34/active 0
/broadlink/ce889b34ea34/poweron 0
/broadlink/ce889b34ea34/weekend [{"start_hour": 8, "temp": 21.5, "start_minute": 0}, {"start_hour": 23, "temp": 15.0, "start_minute": 0}]
/broadlink/ce889b34ea34/auto_mode 0
/broadlink/ce889b34ea34/svl 5
/broadlink/ce889b34ea34/hour 9
/broadlink/ce889b34ea34/svh 35
/broadlink/ce889b34ea34/dif 2
/broadlink/ce889b34ea34/weekday [{"start_hour": 6, "temp": 15.0, "start_minute": 30}, {"start_hour": 9, "temp": 21.0, "start_minute": 0}, {"start_hour": 12, "temp": 21.0, "start_minute": 0}, {"start_hour": 14, "temp": 21.0, "start_minute": 0}, {"start_hour": 18, "temp": 21.0, "start_minute": 0}, {"start_hour": 22, "temp": 21.0, "start_minute": 0}]
/broadlink/ce889b34ea34/schedule [[{"start_hour": 6, "temp": 15.0, "start_minute": 30}, {"start_hour": 9, "temp": 21.0, "start_minute": 0}, {"start_hour": 12, "temp": 21.0, "start_minute": 0}, {"start_hour": 14, "temp": 21.0, "start_minute": 0}, {"start_hour": 18, "temp": 21.0, "start_minute": 0}, {"start_hour": 22, "temp": 21.0, "start_minute": 0}], [{"start_hour": 8, "temp": 21.5, "start_minute": 0}, {"start_hour": 23, "temp": 15.0, "start_minute": 0}]]
^C[09:29:30] openhabian@raspi3:~$

I pulled the latest version but the issue was also in the version before.

Based on your examples i am now able to subscribe and publish most of the thermostat parameters via openhab or mosquitto_sub / mosquitto_pub but 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

@JueFri
Copy link
Author

JueFri commented Mar 23, 2018

@ralphm2004

Setting the loop_mode via the touch screen of the thermostat leads to the following results:

  • LOOP 12345 leads to loop_mode value 1
  • LOOP 123456 leads to loop_mode value 2
  • LOOP 1234567 leads to loop_mode value 3

The description in the config file leads to my confusion

# loop_mode refers to index in { "12345,67" , "123456,7 , "1234567" }
# E.G. loop_mode 2 means very day (including Sat and Sun) follows the weekday schedule
loop_mode = 0

The value of the config option loop_mode is not equal to the value of the variable loop_mode,
so
config option loop_mode = 0 leads to variable loop_mode value 1
config option loop_mode = 1 leads to variable loop_mode value 2
config option loop_mode = 2 leads to variable loop_mode value 3

Is that correct ?

@ralphm2004
Copy link
Owner

@JueFri
Never tested this. The Python API is from mjg59/python-broadlink

@kompio
Copy link

kompio commented Dec 9, 2018

I 'm using loop mode 1234567 and works fine, but if is a sun or sat and I send :
mosquitto_pub -h mqtt -t /broadlink/xxxxxx34ea34/cmd/set_schedule -m '[[{"start_hour": 1, "temp": 21.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": 21.0, "start_minute": 30}, {"start_hour": 22, "temp": 15.0, "start_minute": 0}], [{"start_hour": 8, "temp": 15.0, "start_minute": 0}, {"start_hour": 22, "temp": 15.0, "start_minute": 0}]]'
thermostat shows loop mode (1234567) but is set temperature ( 15 not 21 ) of sun or sat (6 and 7) days ... not days from mon to fri ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants