dk307 / HSPI_InfluxDBPersistence

PlugIn For Homeseer to persist to InfluxDB
MIT License
12 stars 6 forks source link

Send value to influxDb, even if only string is changed? #8

Closed dakipro closed 4 years ago

dakipro commented 4 years ago

Hi, I am trying to log some text value to influxDb, to show some basic log events in the dashboard (f.eks. "temperature is too high, turning AC off"). But the value is not being sent to influxDb unless I then turn the device on or off. Is it possible to do this automatically from the plugin, or would I need to make a rule that will listen to text changes and just toggle the device? Or is it homeseer limitation?

On the side note, string that has quotes is not being sent/stored in influxDb, for example: Scene "Light" is turned on. When I remove the quotes, it works fine. Would you mind fixing this when you have the time, would you like a new issue for this one?

dk307 commented 4 years ago

Where are you changing the string , is it device string ? Are you only changing string ? The plugin only listens to device value change (VALUE_CHANGE). I can also add listening to string value, but may lead of additional unwanted entries in the db.

On the side note, string that has quotes is not being sent/stored in influxDb, for example: Scene "Light" is turned on. When I remove the quotes, it works fine. Would you mind fixing this when you have the time, would you like a new issue for this one?

I will check this out. Thanks for reporting this.

dakipro commented 4 years ago

In my case I was only updating the string yes. I mentioned, I wanted to do some sort of custom log in the table and show it in influxdb, something like: 12:00 motion detected in hallway 12:00 turning on hallway lights to 100% 12:05 dimming hallway lights to 50% 12:06 motion detected in hallway 12:06 turning on hallway lights to 100% 12:11 dimming hallway lights to 50% 12:16 turning off hallway lights

These comments would be set in the events, by setting one device string to some of these values. I am doing that now via easytrigger plugin, and it works ok except that I would also have to switch the state, which complicates things quite a lot.

Can you think about some other (easier) ways this could be achieved perhaps? So basically logging custom text string to influxDb would be awesome if possible, I am pretty sure it can be done via node-red and going around the plugin, but setup might be significantly more complicated then

dk307 commented 4 years ago

I have fixed the quotes issue in https://github.com/dk307/HSPI_InfluxDBPersistence/pull/10. The influx client library had a number of issues. I switched to a new one. It has been working fine for me for last couple of weeks.

dakipro commented 4 years ago

Thanks! I hope you will have time/motivation to check for options to watch for a string change as well. Perhaps it could be a setting somewhere, maybe a config per item on what changes to look for.

dk307 commented 4 years ago

Thats a good idea. I will look into it.

Thanks! On Sat, Mar 7, 2020, 11:11 AM dakipro notifications@github.com wrote:

Thanks! I hope you will have time/motivation to check for options to watch for a string change as well. Perhaps it could be a setting somewhere, maybe a config per item on what changes to look for.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dk307/HSPI_InfluxDBPersistence/issues/8?email_source=notifications&email_token=ACIY7P7TTYNRYN2L6VXUEDDRGKL67A5CNFSM4KRFHF3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOEDD5Y#issuecomment-596128247, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACIY7P3JKW7F2LUN7TTBNX3RGKL67ANCNFSM4KRFHF3A .

dk307 commented 4 years ago

I had added functionality where you can choose to track changes by value or string. Let me know how it works for you.