tim-hellhake / counter-adapter Goto Github PK
View Code? Open in Web Editor NEWLicense: Mozilla Public License 2.0
License: Mozilla Public License 2.0
Hello Tim,
Again another very good add-on, simple but effective. (thumbs up)
Is it possible to give a property to a thing. Now one can only choose a custom thing with your counter add-on.
You could use (misuse) the (multi)LevelProperty just like @mrstegeman does with his Speed test add-on.
Counter:
For the counter add-on you could set the minimum default to 0 and maximum default to 100000000, whereby one can adjust the maximum value in configure. Unit is units or counts ??
You could also use levelProperties with your other add-ons.
OpenUV - Clear sky UV index:
UV level, minimum zero and maximum 10 or Ozon level with a minimum of 100 and maximum of 500, unit is Dobson Unit (DU).
MI Flora:
I ordered two. Do not know what is being shown now.
Timer:
Same as Counter but the other way around. Where you can set maximum in configure. Level property is getting lower. Unit is seconds (s)
Hi @tim-hellhake,
After rebooting the gateway last night the Counter addon was disconnected again. Here are the logs:
Line 18037: 2020-12-16 23:02:27.221 INFO : Loading add-on: counter-adapter Line 18119: 2020-12-16 23:02:43.342 INFO : counter-adapter: Opening database: /home/pi/.webthings/config/db.sqlite3 Line 18120: 2020-12-16 23:02:43.346 INFO : counter-adapter: Ignoring https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/schema.json because it has no messageType Line 18169: 2020-12-16 23:02:47.529 INFO : date-time-adapter: AddonManagerProxy: recv: {'messageType': 8207, 'data': {'deviceId': 'counter-8b2dc908b304bcfd59405c200923816e', 'device': {'title': 'Low battery notifications', '@context': 'https://iot.mozilla.org/schemas/', '@type': ['MultiLevelSensor'], 'description': '', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e', 'properties': {'count': {'name': 'count', 'visible': True, 'title': 'Count', 'type': 'integer', '@type': 'LevelProperty', 'readOnly': True, 'links': [{'rel': 'property', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/properties/count'}]}}, 'actions': {'reset': {'title': 'Reset', 'description': 'Reset the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/reset'}]}, 'increment': {'title': 'Increment', 'description': 'Increment the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/increment'}]}}, 'events': {}, 'l... Line 18169: 2020-12-16 23:02:47.529 INFO : date-time-adapter: AddonManagerProxy: recv: {'messageType': 8207, 'data': {'deviceId': 'counter-8b2dc908b304bcfd59405c200923816e', 'device': {'title': 'Low battery notifications', '@context': 'https://iot.mozilla.org/schemas/', '@type': ['MultiLevelSensor'], 'description': '', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e', 'properties': {'count': {'name': 'count', 'visible': True, 'title': 'Count', 'type': 'integer', '@type': 'LevelProperty', 'readOnly': True, 'links': [{'rel': 'property', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/properties/count'}]}}, 'actions': {'reset': {'title': 'Reset', 'description': 'Reset the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/reset'}]}, 'increment': {'title': 'Increment', 'description': 'Increment the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/increment'}]}}, 'events': {}, 'l... Line 18169: 2020-12-16 23:02:47.529 INFO : date-time-adapter: AddonManagerProxy: recv: {'messageType': 8207, 'data': {'deviceId': 'counter-8b2dc908b304bcfd59405c200923816e', 'device': {'title': 'Low battery notifications', '@context': 'https://iot.mozilla.org/schemas/', '@type': ['MultiLevelSensor'], 'description': '', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e', 'properties': {'count': {'name': 'count', 'visible': True, 'title': 'Count', 'type': 'integer', '@type': 'LevelProperty', 'readOnly': True, 'links': [{'rel': 'property', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/properties/count'}]}}, 'actions': {'reset': {'title': 'Reset', 'description': 'Reset the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/reset'}]}, 'increment': {'title': 'Increment', 'description': 'Increment the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/increment'}]}}, 'events': {}, 'l... Line 18169: 2020-12-16 23:02:47.529 INFO : date-time-adapter: AddonManagerProxy: recv: {'messageType': 8207, 'data': {'deviceId': 'counter-8b2dc908b304bcfd59405c200923816e', 'device': {'title': 'Low battery notifications', '@context': 'https://iot.mozilla.org/schemas/', '@type': ['MultiLevelSensor'], 'description': '', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e', 'properties': {'count': {'name': 'count', 'visible': True, 'title': 'Count', 'type': 'integer', '@type': 'LevelProperty', 'readOnly': True, 'links': [{'rel': 'property', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/properties/count'}]}}, 'actions': {'reset': {'title': 'Reset', 'description': 'Reset the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/reset'}]}, 'increment': {'title': 'Increment', 'description': 'Increment the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/increment'}]}}, 'events': {}, 'l... Line 18169: 2020-12-16 23:02:47.529 INFO : date-time-adapter: AddonManagerProxy: recv: {'messageType': 8207, 'data': {'deviceId': 'counter-8b2dc908b304bcfd59405c200923816e', 'device': {'title': 'Low battery notifications', '@context': 'https://iot.mozilla.org/schemas/', '@type': ['MultiLevelSensor'], 'description': '', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e', 'properties': {'count': {'name': 'count', 'visible': True, 'title': 'Count', 'type': 'integer', '@type': 'LevelProperty', 'readOnly': True, 'links': [{'rel': 'property', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/properties/count'}]}}, 'actions': {'reset': {'title': 'Reset', 'description': 'Reset the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/reset'}]}, 'increment': {'title': 'Increment', 'description': 'Increment the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/increment'}]}}, 'events': {}, 'l... Line 18169: 2020-12-16 23:02:47.529 INFO : date-time-adapter: AddonManagerProxy: recv: {'messageType': 8207, 'data': {'deviceId': 'counter-8b2dc908b304bcfd59405c200923816e', 'device': {'title': 'Low battery notifications', '@context': 'https://iot.mozilla.org/schemas/', '@type': ['MultiLevelSensor'], 'description': '', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e', 'properties': {'count': {'name': 'count', 'visible': True, 'title': 'Count', 'type': 'integer', '@type': 'LevelProperty', 'readOnly': True, 'links': [{'rel': 'property', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/properties/count'}]}}, 'actions': {'reset': {'title': 'Reset', 'description': 'Reset the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/reset'}]}, 'increment': {'title': 'Increment', 'description': 'Increment the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/increment'}]}}, 'events': {}, 'l... Line 18169: 2020-12-16 23:02:47.529 INFO : date-time-adapter: AddonManagerProxy: recv: {'messageType': 8207, 'data': {'deviceId': 'counter-8b2dc908b304bcfd59405c200923816e', 'device': {'title': 'Low battery notifications', '@context': 'https://iot.mozilla.org/schemas/', '@type': ['MultiLevelSensor'], 'description': '', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e', 'properties': {'count': {'name': 'count', 'visible': True, 'title': 'Count', 'type': 'integer', '@type': 'LevelProperty', 'readOnly': True, 'links': [{'rel': 'property', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/properties/count'}]}}, 'actions': {'reset': {'title': 'Reset', 'description': 'Reset the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/reset'}]}, 'increment': {'title': 'Increment', 'description': 'Increment the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/increment'}]}}, 'events': {}, 'l... Line 18169: 2020-12-16 23:02:47.529 INFO : date-time-adapter: AddonManagerProxy: recv: {'messageType': 8207, 'data': {'deviceId': 'counter-8b2dc908b304bcfd59405c200923816e', 'device': {'title': 'Low battery notifications', '@context': 'https://iot.mozilla.org/schemas/', '@type': ['MultiLevelSensor'], 'description': '', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e', 'properties': {'count': {'name': 'count', 'visible': True, 'title': 'Count', 'type': 'integer', '@type': 'LevelProperty', 'readOnly': True, 'links': [{'rel': 'property', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/properties/count'}]}}, 'actions': {'reset': {'title': 'Reset', 'description': 'Reset the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/reset'}]}, 'increment': {'title': 'Increment', 'description': 'Increment the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/increment'}]}}, 'events': {}, 'l... Line 18169: 2020-12-16 23:02:47.529 INFO : date-time-adapter: AddonManagerProxy: recv: {'messageType': 8207, 'data': {'deviceId': 'counter-8b2dc908b304bcfd59405c200923816e', 'device': {'title': 'Low battery notifications', '@context': 'https://iot.mozilla.org/schemas/', '@type': ['MultiLevelSensor'], 'description': '', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e', 'properties': {'count': {'name': 'count', 'visible': True, 'title': 'Count', 'type': 'integer', '@type': 'LevelProperty', 'readOnly': True, 'links': [{'rel': 'property', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/properties/count'}]}}, 'actions': {'reset': {'title': 'Reset', 'description': 'Reset the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/reset'}]}, 'increment': {'title': 'Increment', 'description': 'Increment the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/increment'}]}}, 'events': {}, 'l... Line 18169: 2020-12-16 23:02:47.529 INFO : date-time-adapter: AddonManagerProxy: recv: {'messageType': 8207, 'data': {'deviceId': 'counter-8b2dc908b304bcfd59405c200923816e', 'device': {'title': 'Low battery notifications', '@context': 'https://iot.mozilla.org/schemas/', '@type': ['MultiLevelSensor'], 'description': '', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e', 'properties': {'count': {'name': 'count', 'visible': True, 'title': 'Count', 'type': 'integer', '@type': 'LevelProperty', 'readOnly': True, 'links': [{'rel': 'property', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/properties/count'}]}}, 'actions': {'reset': {'title': 'Reset', 'description': 'Reset the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/reset'}]}, 'increment': {'title': 'Increment', 'description': 'Increment the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/increment'}]}}, 'events': {}, 'l... Line 18169: 2020-12-16 23:02:47.529 INFO : date-time-adapter: AddonManagerProxy: recv: {'messageType': 8207, 'data': {'deviceId': 'counter-8b2dc908b304bcfd59405c200923816e', 'device': {'title': 'Low battery notifications', '@context': 'https://iot.mozilla.org/schemas/', '@type': ['MultiLevelSensor'], 'description': '', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e', 'properties': {'count': {'name': 'count', 'visible': True, 'title': 'Count', 'type': 'integer', '@type': 'LevelProperty', 'readOnly': True, 'links': [{'rel': 'property', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/properties/count'}]}}, 'actions': {'reset': {'title': 'Reset', 'description': 'Reset the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/reset'}]}, 'increment': {'title': 'Increment', 'description': 'Increment the counter', 'links': [{'rel': 'action', 'href': '/things/counter-8b2dc908b304bcfd59405c200923816e/actions/increment'}]}}, 'events': {}, 'l... Line 18362: 2020-12-16 23:02:49.517 INFO : counter-adapter: Ignoring https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json because it has no messageType Line 18409: 2020-12-16 23:03:06.162 INFO : counter-adapter: Loading add-on counter-adapter from /home/pi/.webthings/addons/counter-adapter Line 18409: 2020-12-16 23:03:06.162 INFO : counter-adapter: Loading add-on counter-adapter from /home/pi/.webthings/addons/counter-adapter Line 18409: 2020-12-16 23:03:06.162 INFO : counter-adapter: Loading add-on counter-adapter from /home/pi/.webthings/addons/counter-adapter Line 18492: 2020-12-16 23:03:16.181 INFO : counter-adapter: Unhandled Rejection Line 18493: 2020-12-16 23:03:16.187 ERROR : counter-adapter: { [Error: SQLITE_BUSY: database is locked] errno: 5, code: 'SQLITE_BUSY' } Line 19271: 2020-12-16 23:04:02.720 INFO : macrozilla: counter-8b2dc908b304bcfd59405c200923816e : Added Line 19304: 2020-12-16 23:04:04.041 ERROR : Failed to get property count: getProperty: device: counter-8b2dc908b304bcfd59405c200923816e not found. Line 19841: 2020-12-16 23:04:26.256 INFO : macrozilla: counter-8b2dc908b304bcfd59405c200923816e : Added Line 19864: 2020-12-16 23:04:27.236 ERROR : Failed to get property count: getProperty: device: counter-8b2dc908b304bcfd59405c200923816e not found. Line 22267: 2020-12-16 23:11:33.548 WARN : Unable to dispatch action requestAction: device: counter-8b2dc908b304bcfd59405c200923816e not found. Line 30753: 2020-12-16 23:41:33.636 WARN : Unable to dispatch action requestAction: device: counter-8b2dc908b304bcfd59405c200923816e not found. Line 31274: 2020-12-16 23:43:32.124 ERROR : Failed to get property count: getProperty: device: counter-8b2dc908b304bcfd59405c200923816e not found.
Cheers ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.