SevenW/Plugwise-2-py

Circles not responding to switch commands and schedules

N-Rico opened this issue · 8 comments

Hi,

I'm trying to get this to work on my PI 3 (Raspbian Stretchy), but can't get the circles to pickup any schedules or respond to the switch commands. (also no wattage shown in pw2py.html)

Everything seems fine in the pw-logger.log, I see schedule changes being sent to the device and I don't see any error messages coming back.

2018-01-09 07:58:10,901 - pw-logger - INFO - apply_schedule_changes: schedule changed. Update in circle Aquariumlamp - test 2018-01-09 07:58:10,902 - pw-logger - INFO - circle.define_schedule. 2018-01-09 07:58:10,916 - pw-logger - INFO - API 000D6F0004465F33 Aquariumlamp circle schedule off 2018-01-09 07:58:10,977 - pw-logger - INFO - circle.load_schedule. enter function 2018-01-09 07:58:16,461 - pw-logger - INFO - circle.load_schedule. exit function 2018-01-09 07:59:00,562 - pw-logger - INFO - 000D6F0004465F33: save log 2018-01-09 07:59:10,461 - pw-logger - INFO - 000D6F0005A9050E: save log 2018-01-09 07:59:20,709 - pw-logger - INFO - API 000D6F0005A9050E Aquariumpomp circle schedule off 2018-01-09 08:00:00,287 - pw-logger - INFO - 000D6F0004465F33: save log 2018-01-09 08:00:00,502 - pw-logger - INFO - circle buffers: 000D6F0004465F33 16 2018-01-09 08:00 3 3 2018-01-09 08:00:00,578 - pw-logger - INFO - circle buffers: 000D6F0004465F33 Aquariumlamp read from 16 to 17 2018-01-09 08:00:10,256 - pw-logger - INFO - 000D6F0005A9050E: save log 2018-01-09 08:00:10,598 - pw-logger - INFO - circle buffers: 000D6F0005A9050E 16 2018-01-09 08:00 13 13 2018-01-09 08:00:10,715 - pw-logger - INFO - circle buffers: 000D6F0005A9050E Aquariumpomp read from 16 to 17

cat /tmp/pwpower.log shows accurate power consumption, but any changes I make in cfg-pw2py.html don't seem to make it to /tmp/pw-status.json

What am I doing wrong? :)

Thanks in advance!

Enrico

I assume that you made the schedule changes also in the webUI. So some form of communication between the webUI and plugwise-2-py is happening.. But not complete if I understand correctly. The webUI for to switch and observe consumption does not get updated, if I read correctly.

Can you switch lights on and off through webUI?
Does the schedule function?
From attached logging I read that the schedules are downloaded but not turned on.

SevenW

thanks for your reply.

The switch functions in the webUI don't work. If I switch a light to off and refresh the page, it's on again (depending on what is configured in pw-control.json I guess)

The schedule doesn't function either, I had the schedule checkbox unchecked in the circle properties. I just now edited the schedule a bit, saved it and checked the schedule box in the properties:
2018-01-10 09:28:20,220 - pw-logger - INFO - generate schedule: __PW2PY__test-alternate 2018-01-10 09:28:20,222 - pw-logger - INFO - generate schedule: __PW2PY__test-10 2018-01-10 09:28:20,225 - pw-logger - INFO - import schedule: test.json 2018-01-10 09:28:20,228 - pw-logger - INFO - import schedule: winter.json 2018-01-10 09:28:20,230 - pw-logger - INFO - import schedule: carcharging.json 2018-01-10 09:28:20,233 - pw-logger - INFO - import schedule: testsched1.json 2018-01-10 09:28:20,235 - pw-logger - INFO - import schedule: testsched2.json 2018-01-10 09:29:00,459 - pw-logger - INFO - 000D6F0004465F33: save log 2018-01-10 09:29:10,364 - pw-logger - INFO - 000D6F0005A9050E: save log 2018-01-10 09:29:10,939 - pw-logger - INFO - API 000D6F0005A9050E Aquariumpomp circle schedule off 2018-01-10 09:29:11,211 - pw-logger - INFO - circle mac: 000D6F0004465F33 needs schedule to be defined 2018-01-10 09:29:11,212 - pw-logger - INFO - circle.define_schedule. 2018-01-10 09:29:11,226 - pw-logger - INFO - circle mac: 000D6F0004465F33 needs schedule to be uploaded 2018-01-10 09:29:11,227 - pw-logger - INFO - API 000D6F0004465F33 Aquariumlamp circle schedule off 2018-01-10 09:29:11,289 - pw-logger - INFO - circle.load_schedule. enter function 2018-01-10 09:29:16,738 - pw-logger - INFO - circle.load_schedule. exit function 2018-01-10 09:30:00,315 - pw-logger - INFO - 000D6F0004465F33: save log 2018-01-10 09:30:00,759 - pw-logger - INFO - API 000D6F0005A9050E Aquariumpomp circle schedule off 2018-01-10 09:30:10,210 - pw-logger - INFO - 000D6F0005A9050E: save log

At the moment I do not see what is wrong here. The schedule can be edited with the web UI, and is installed correctly. The schedule is however not activated.

This can also be done through the web UI. If switch functions in the web UI do not come accross, then it looks like something is wrong with the MQTT communication between plugwise-2py and plugwise-2-py-web. Can you check whether MQTT connections are made well between both programs?

A failure of properties from webpage cfg-pw2py.html to be actuated in Plugwise-2-py indicates an issue with being able to write to the pw-conf.json (or pw-control.json). Can you first check whether those files get modified when editing properties in cfg-pw2py?

Hi!

I have the exact same behaviour.

  • I can see in the logs that data is collected from the circles.
  • I can edit and save a schedule and rename circles through the web interface. These changes stick.
  • If I rename and change location on a circle the name is changed in both pw-conf.json and pw-control.json but location is only changed in pw-control.json
  • Nothing happens if I turn off a circle in the web interface. If I refresh the page it reverts to on on the page.
The weblog pwlog/pw-web.log doesn't contain any errors:

2018-02-22 07:58:38,459 - pw-web - DEBUG - nnnnnnnn handle done on worker thread 140319921231616
2018-02-22 07:58:38,459 - pw-web - DEBUG - nnnnnnnn  handle done on worker thread 140319887660800
2018-02-22 07:58:38,460 - pw-web - DEBUG - nnnnnnnn  finish entry on worker thread 140319887660800
2018-02-22 07:58:38,460 - pw-web - DEBUG - nnnnnnnn  finish entry on worker thread 140319921231616
2


The only errors I found so far in the logs are these that pop up here and there in pwlog/pw-logger.log

2018-02-22 08:01:21,859 - pw-logger - DEBUG - PARS      'FFFFFFFF' EVAL 'None'
2018-02-22 08:01:21,859 - pw-logger - DEBUG - PARS      'FFFFFFFF' EVAL '-1'
2018-02-22 08:01:21,859 - pw-logger - DEBUG - PARS      'FF' EVAL '2255'
2018-02-22 08:01:21,859 - pw-logger - DEBUG - PARS      'FF' EVAL '255'
2018-02-22 08:01:21,859 - pw-logger - DEBUG - PARS      'FFFF' EVAL '65535'
2018-02-22 08:01:21,859 - pw-logger - DEBUG - value error while attempting to construct datetime object
2018-02-22 08:01:21,859 - pw-logger - DEBUG - PARS      'FFFFFFFF' EVAL 'None'
2018-02-22 08:01:21,859 - pw-logger - DEBUG - PARS      'FFFFFFFF' EVAL '-1'
2018-02-22 08:01:21,859 - pw-logger - DEBUG - PARS      'FF' EVAL '2255'
2018-02-22 08:01:21,860 - pw-logger - DEBUG - PARS      'FF' EVAL '255'
2018-02-22 08:01:21,860 - pw-logger - DEBUG - PARS      'FFFF' EVAL '65535'
2018-02-22 08:01:21,860 - pw-logger - DEBUG - value error while attempting to construct datetime object
2018-02-22 08:01:21,860 - pw-logger - DEBUG - PARS      'FFFFFFFF' EVAL 'None'
2

sorry for my late response, I will need to switch back to this plugin to test. I'm currently using a different setup with openhab2 (less functionality).

Oooooohhhh! It works as it should now. I didn't change anything, just had some idle time go by, half an hour or one hour or so. I get power consumption figures on the web page and I can turn on and off all circles!

My guess why it didn't work before, is the long first run communicating with the circles and collecting all old data from them (as mentioned in the readme this can take considerable time). Could that be the case?

Anyway, everything seems ok. Very nice piece of kit this Plugwise2py!!!

@MagnusThome: Good to hear it works!

@N-Rico: No need to test any furhter if you are not using it. Recently I noticed that openhab made great progress and that openhab2 is very usable by now. I am going to revisit openhab2 soon, and make a mqtt interface between plugwise2py and openhab2. Plugwise2py has indeed more advanced functionality, which I (obviously) personally appreciate. For example the robustness for errors in communication such as retries and handling out of sequence responses.