Update to 0.10 broke Timer add-on things (now are "disconnected")

I’ve actually fixed this on the master branch already, post-0.10.

To fix things on the release build, you’ll have to do something like this on the command line:

sqlite3 ~/.mozilla-iot/config/db.sqlite3 "SELECT id FROM things"
# Find the ID of your old thing(s).
# The IDs were previously identical to the name you assigned.
sqlite3 ~/.mozilla-iot/config/db.sqlite3 "DELETE FROM things WHERE id = 'your id'"

Replace your id with… your ID.

After that, you can restart the gateway:

sudo systemctl restart mozilla-iot-gateway
1 Like

Thanks, I had the same problem and solved by doing that.

It isn’t working for me.

sqlite3 ~/.mozilla-iot/config/db.sqlite3 "SELECT id FROM things"

only returns the IDs of valid things. The timer IDs are all for the newly created timers that work. There are no IDs for the old timers that don’t work and I can’t get rid of.

I tried to do

sqlite3 ~/.mozilla-iot/config/db.sqlite3 "DELETE FROM things WHERE id = 'Leak-state'"

where 'Leak-state' is the display name of one of the old timers. (The new working timer has a slightly different display name.)

Also, I can’t get rid of the Zigbee device that I removed from the gateway (and removed the battery from the actual device.) I did

sqlite3 ~/.mozilla-iot/config/db.sqlite3 "DELETE FROM things WHERE id = 'zb-8418260000e90e56'"

and restarted the gateway. 'zb-8418260000e90e56' is the actual id. But it won’t go away. I can remove it on the Things page. But if I go into pair mode by clicking on the “+”, it keeps reappearing.

Just to double check, I’m restarting the gateway like

sudo systemctl restart mozilla-iot-gateway.service

Correct?

The command worked for me. I was able to remove both the old timers. Did you get any errors when running the sqlite3 delete command?

No. No errors at all.

If you run it again, do you get an error? You should since the ID should not longer exist.

I ran

sqlite3 ~/.mozilla-iot/config/db.sqlite3 "DELETE FROM things WHERE id = 'zb-8418260000e90e56'"

three times in a row and no error messages.

Did you try a reboot afterwords? I know it should not be necessary when restarting the service, but it would not hurt to try anyway.

Since the v0.10 update, I have been having weird random problems too. The gateway will lose connection to my HABridge about ever other day. This never happened before. This one has not been an issue for me.

Just rebooted and no change. The old timers still show up on the Things page. The phantom Zigbee on/off switch still shows up when I get into pairing mode with the “+” icon.

Mine are more of an aesthetic blemish. I’m happy to have working timers again. The gateway seems to be working otherwise. But I’m not connected to anything like an HA Bridge.

So when you do the above command, your old timers are still listed? My new timers show up like timer-109aa0e9ba1aeb5bfb68e850581af456. My old ones had the name I assigned to them.

I am wondering if your browser cache is keeping them?

Nope. (Using Chrome on Windows 10). I just cleared the cache and no change.

I think at this point it is best to wait for @mstegeman to weigh in.

Yup, I agree. Shame you are having this problem.

This is very strange. Try this:

  1. Stop the gateway: sudo systemctl stop mozilla-iot-gateway
  2. Check out the IDs that are currently in the database, with the SELECT from above.
  3. Delete anything that shouldn’t be there.
  4. Start the gateway: sudo systemctl start mozilla-iot-gateway.

The difference here being that you’re doing the database work while the gateway is stopped, rather than while it’s still running.

I did this. None of the ghost old timers show up in the results of the SELECT (after stopping the gateway). The id of the ghost deleted Zigbee on/switch does show up (after I paired it with the “+” icon, with the gateway running.)

With the gateway stopped I did

sqlite3 ~/.mozilla-iot/config/db.sqlite3 "DELETE FROM things WHERE id = 'zb-8418260000e90e56'"

Then selected IDs and 'zb-8418260000e90e56' didn’t show up.

But after I restarted the gate-way 'zb-8418260000e90e56' shows up as wanting to be paired after I click on the “+” icon. Again, the battery has been removed from this device for several days. This is the only device of this type I own (a SYLVANIA SMART+ ZigBee 2 Button Dimming Switch) so it couldn’t be confused with another on/off switch. (It is also the only device I own whose temperature sensor reads 253 degrees F in my living room, which it still does in its ghost state with its battery removed. Its temperature read in that range back when it had a battery installed and was paired properly.))

The Zigbee thing is a separate issue: https://github.com/mozilla-iot/zigbee-adapter/issues/174

Does this mean your old timers are gone now?

No. They are still there on the things page, showing as disconnected. As best as I can tell they aren’t showing up in the database when I select by IDs. The working timers show up twice: once by display name and also by ID (which match what I see when I open the config page for the timer add-on. The ghost timers do not show up on the timer config page.)

Can you post the output of the SELECT?

Basement too cold
DateTimeDevice
Lvg Rm long period
Motion detect 1 time
Night light state
Water pump state
etekcity-8d42f4a6-f8f3-4600-9f7d-03b9b30955f9
etekcity-b71c0c09-58e4-43fc-b21f-2b845508030d
etekcity-e75e2f40-4955-407b-9397-99ed5bf8f039
my-example-plug
timer-02c2754ce8b609cc81396454bce047e4
timer-48b73bdec00fb3633922c4fe0c22fe8e
timer-7eb3530023c06c44cf7e29282f17255e
timer-da9e03dfacd523e4cbc4b09b403b53fe
tplink-800612FD8CE76A9966E3FAF11510FF081BC1ED0D00
tplink-800612FD8CE76A9966E3FAF11510FF081BC1ED0D01
tplink-801262D62CA03C743B55DBD91F7456051B185EB7
tplink-8012B36D219C62A83B3A4AEF75D15EE01B0EA846
weather-146ad51de6a4a3cee6ab84923bc6971fdc3bf23b
zb-000d6f000f7f69a6
zb-286d970001058098
zb-286d9700010580b7
zb-286d97000105c4fb
zb-286d97000107a85b
zb-286d970001091f9c
zb-286d97000109813a
zb-8418260000e90e56
zb-f0d1b80000032b14
zb-f0d1b8000003ec27
zb-f0d1b8000010e6f1

The four timer IDs match the IDs of the newly created and working timers. Some of the text descriptions match the display names of the timers and some don’t. I don’t see any of the text descriptions that match the ghost timers. Some of the text descriptions match older versions the timers and others do not.

e.g., “Water pump state” was originally “Water-pump-state” (hyphens…) But was renamed to “Leak state” (current working timer) and “Leak-state” (current ghost defunct timer) after I added a leak detector to my hot water tank.