Today plugin broken

Hi all

My Today plugin is broken. I can’t seem to see anything wrong on the logs. But after updating to the latest version it just has a red bar across the top of the thing say thing setup failed.

This is a pain as i was using the sunset event to trigger lights.

Simon

Hey Simon. If it says the setup failed, there really should be an error message in the logs though… Can you please check again? Nymea should try to re-setup it every 15 seconds. I’ll verify the code tomorrow if there could be a code path where it fails without error message.

Hi

Thanks for getting back to me. The only repeated error in the log is
#033[33m W | ScriptEngine: “file:///var/lib/nymea/scripts/f3512414-b12c-4a74-83ab-a4a77a8d8954.qml:64: Error: Invalid state”#033[0m

but this guid does not relate to any of the guids for the Today thing.

This morning nymea states the Today thing is okay but the sunset, dusk, sunrise are all set to 01/01/1970 01:00 so the state is not updating on them. I am also unable to reconfigure the thing or add a new thing.

I tried deleting it and adding it again and got the following messages in the log

W | DateTime: There is already a date thing or not deleted correctly! this should never happen!!
W | ThingManager: Thing reconfiguration failed for “Today” “{16e860f5-1b26-47b9-b69d-17c22dc6508b}” Thing::ThingErrorHardwareNotAvailable “”
W | ScriptEngine: “file:///var/lib/nymea/scripts/f3512414-b12c-4a74-83ab-a4a77a8d8954.qml:64: Error: Invalid state”
W | ScriptEngine: “file:///var/lib/nymea/scripts/f3512414-b12c-4a74-83ab-a4a77a8d8954.qml:64: Error: Invalid state”
W | ScriptEngine: “file:///var/lib/nymea/scripts/f3512414-b12c-4a74-83ab-a4a77a8d8954.qml:64: Error: Invalid state”
W | ScriptEngine: “file:///var/lib/nymea/scripts/f3512414-b12c-4a74-83ab-a4a77a8d8954.qml:64: Error: Invalid state”
W | DateTime: There is already a date thing or not deleted correctly! this should never happen!!
W | ThingManager: Thing setup failed. Not adding thing to system.

Simon

I have been watching the event log and had this entry

#033[33m W | Platform: Platform plugin does not implement deviceSerialNumber and DEVICE_SERIAL is not set. Cannot determine device serial number.#033[0m
Jul 27 09:09:37 localhost dbus-daemon[335]: [system] Activating via systemd: service name=‘org.freedesktop.timedate1’ unit=‘dbus-org.freedesktop.timedate1.service’ requested by ‘:1.12’ (uid=0 pid=461 comm="/usr/bin/nymead -n ")
Jul 27 09:09:37 localhost systemd[1]: Starting Time & Date Service…
Jul 27 09:09:37 localhost dbus-daemon[335]: [system] Successfully activated service ‘org.freedesktop.timedate1’
Jul 27 09:09:37 localhost systemd[1]: Started Time & Date Service.
Jul 27 09:09:38 localhost nymead[461]: #033[33m W | AWS: Pairing failed: 401 “Unauthorized - Token invalid: jwt expired”#033[0m

could the last entry have something to do with this as I think it may have stop work a few days ago but I have only just notice as my other half has been turning the lights on as they have not been coming on.

I am also getting this entry as well

DateTime: Http error status for time request: QNetworkReply::SslHandshakeFailedError

Simon

There is already a date thing or not deleted correctly! this should never happen!!

Looking at the code of the plugin, this message seems to be generated when you try to add 2 today devices. The plugin can only deal with a single one.

DateTime: Http error status for time request: QNetworkReply::SslHandshakeFailedError

This one indicates that it failed to connect to https://api.sunrise-sunset.org/. Perhaps the clock is not set up properly? That could cause such errors. Verify the date & time settings in system settings → General Settings.

Thanks for the response, I have checked and there is only one today item. I did have a daylight sensor but I was not using it so I removed it.

The time and date are correct. I suspect the issue not nymea but sunrise-sunset.org. I SSH’ed on the nymea box and this is the wget response

https://api.sunrise-sunset.org/
Resolving api.sunrise-sunset.org (api.sunrise-sunset.org)… 45.33.59.78
Connecting to api.sunrise-sunset.org (api.sunrise-sunset.org)|45.33.59.78|:443… connected.
ERROR: The certificate of ‘api.sunrise-sunset.org’ is not trusted.
ERROR: The certificate of ‘api.sunrise-sunset.org’ has expired.
The certificate has expired

Just going to have to ride it out until they renew their certificate.

Thanks