henry-spanka / freeathome-api

Busch-Jaeger free@home API to control actuators
MIT License
45 stars 4 forks source link

No Updates are shown in "info" #11

Closed SchuldtOH closed 4 years ago

SchuldtOH commented 4 years ago

I use the docker container latest tag. When starting the container the status off all items is once updated on start up. After that I can perform actions like switching a device on or off, but the "info" stays the same and does not update any more. Only stopping and starting the container again shows the new status. In the log file I can see the "INFO: Sent Subscription Confirmation".

Can anyone confirm this?

henry-spanka commented 4 years ago

That should not happen. Do you see "Updated Datapoint" messages when enabling debug mode?

SchuldtOH commented 4 years ago

How can I enable the debug mode in docker? There is no env variable for that.

ZzAve commented 4 years ago

There's an env variable 'FREEATHOME_DEBUG' which you can set to true.

from index.ts (now apprunner.ts) config = new Configuration(clientConfiguration, httpConfiguration, wsConfiguration, 'FREEATHOME_DEBUG' in process.env && process.env.FREEATHOME_DEBUG == '1')

SchuldtOH commented 4 years ago

In debug mode I see only lots of messages like:

DEBUG: [(here IP adress):40691]: Received Webserver message, command info, params
DEBUG: [object Object]

When switching the lights by the api I get

INFO: Set Datapoint: xxx/chxxx/idp0000/1
DEBUG: Received new output data:
DEBUG: <iq xmlns="jabber:client" to="mrha@busch-jaeger.de/rpc" type="set" id="1572775191832"><query xmlns="jabber:iq:rpc"><methodCall><methodName>RemoteInterface.cryptMessage</methodName><params><param><value><base64>(here long code)</base64></value></param></params></methodCall></query></iq> | s -- | --
DEBUG: Received new input data:
DEBUG: <iq from="mrha@busch-jaeger.de/rpc" id="1572775191832" to="installer@busch-jaeger.de/freeathome-api" type="result"><query xmlns="jabber:iq:rpc"><methodResponse><params><param><value><base64>(here long code)</base64></value></param></params></methodResponse></query></iq> |  -- | --
DEBUG: Received stanza:
DEBUG: Element { (here some data) }
DEBUG: Received RPC Call Result Message

But no "Updated datapoint" messages.

ZzAve commented 4 years ago

What is the reason you want to see this in the "info" logs? Seeing that updates will happen periodically, and I can imagine that logs will grow quite quickly, this might not be an ideal solution. But please, elaborate on why you'd like this functionality.

SchuldtOH commented 4 years ago

Sorry, that is a misunderstanding. I certainly don't want to see that in the info-log. My problem is, I don't get any updates in the http-api. On startup all states are updated only once, that stay fixed forever. I use the info payload to get all states, that is the reason for the title. Setting datapoints with the raw payload works fine.

henry-spanka commented 4 years ago

I am aware of one issue that may cause this. The Access Point sometimes doesn't send any updates although we are subscribed. I couldn't figure out the reason yet but you need to login with the API user once into the GUI and click on some buttons in the GUI (e.g. show floor plan etc.) and then logout again. Then restart the API and it should (hopefully) work.

SchuldtOH commented 4 years ago

Yes, that workaround solved the problem. Thanks!

henry-spanka commented 4 years ago

Ok, thanks for the heads up. I think we should document that workaround in the readme. ... and also document the debug environment variable.

henry-spanka commented 4 years ago

debug variable documented in 22376cc5b88b45b9e56ef3f8a9b69e883775cdd0.

I think we can close this now.