openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.7k forks source link

HomeMatic binding and InfluxDB persistence #2012

Closed itn3rd77 closed 9 years ago

itn3rd77 commented 9 years ago

I suspect there is some problem with the HomeMatic binding and the persistence in general or maybe only with the InfluxDB persistence. My HomeMatic items are only persistet when I start openHAB. Further updates are not propagated or recognized by the persistence service even so updates happen to my homeMatic items.

This is my influxdb.persist configuration

Strategies {                                                                                                                                                                  
    everyHour   : "0 0 * * * ?"                                                                                                                                               
    everyDay    : "0 0 0 * * ?"                                                                                                                                               

    // If no strategy is specified for an item entry below, the default list will be used                                                                                     
    default = everyChange                                                                                                                                                     
}                                                                                                                                                                             

/*                                                                                                                                                                            
 * Each line in this section defines for which item(s) which strategy(ies) should be applied.                                                                                 
 * You can list single items, use "*" for all items or "groupitem*" for all members of a group                                                                                
 * item (excl. the group item itself).                                                                                                                                        
 */                                                                                                                                                                           
Items {                                                                                                                                                                       
    // Persist all items once a day and on every change and restore them from the db at startup                                                                               
    * : strategy = everyUpdate, everyDay, restoreOnStartup                                                                                                                    
} 

Here ist a little graph made from the values that got persisted in the InfluxDB. The first graph shows some temperatures collected from some HomeMatic devices and the second graph shows the Azimuth und Elevation from the Astro-Binding.

grafana

The dots on the line represent a update/change of the value. As one can see the items from the Astro-Binding get updates and are persistet whereas the HomeMatic item only have a data point from each start of openHAB I made.

@gerrieg Can you please have look at this?

gerrieg commented 9 years ago

The persistence services are completely decoupled from the bindings. So i don't think it's a binding issue. I'm using mysql-persistence with the everyChange strategy to store the temperatures and have no problems.

First you have to find out if the influxdb service is executed on item updates. Add this to your logback.xml:

<logger name="org.openhab.persistence.influxdb" level="TRACE />

Now you should see 'storing ... in influxdb ...' if something is written into the database. Try this please, then we know if it's the database itself or the strategy.

itn3rd77 commented 9 years ago

Thanks for your quick reply!

This are some examples from the startup...

...
20:59:18.680 [TRACE] [i.i.InfluxDBPersistenceService:187  ] - storing SENSOR_GF_LR_Heater3_BS in influxdb 2.8
20:59:18.683 [INFO ] [runtime.busevents             :26   ] - SHUTTER_FF_HO_Window1 state updated to 100
20:59:18.684 [TRACE] [i.i.InfluxDBPersistenceService:406  ] - found no fractional part
20:59:18.684 [TRACE] [i.i.InfluxDBPersistenceService:187  ] - storing gShutter in influxdb 100
20:59:18.687 [TRACE] [i.i.InfluxDBPersistenceService:406  ] - found no fractional part
20:59:18.688 [TRACE] [i.i.InfluxDBPersistenceService:187  ] - storing gFF_Shutter in influxdb 100
20:59:18.691 [TRACE] [i.i.InfluxDBPersistenceService:406  ] - found no fractional part
20:59:18.691 [TRACE] [i.i.InfluxDBPersistenceService:187  ] - storing gShutter in influxdb 100
20:59:18.694 [TRACE] [i.i.InfluxDBPersistenceService:406  ] - found no fractional part
20:59:18.694 [TRACE] [i.i.InfluxDBPersistenceService:187  ] - storing SHUTTER_FF_HO_Window1 in influxdb 100
20:59:18.698 [TRACE] [i.i.InfluxDBPersistenceService:406  ] - found no fractional part
20:59:18.698 [TRACE] [i.i.InfluxDBPersistenceService:187  ] - storing gShutter in influxdb 100
20:59:18.701 [TRACE] [i.i.InfluxDBPersistenceService:406  ] - found no fractional part
20:59:18.701 [TRACE] [i.i.InfluxDBPersistenceService:187  ] - storing gFF_Shutter in influxdb 100
...

Later on I saw some updates from the Astro-Binding. But no updates happen for any of my HomeMatic items, e.g. if I open the shutters.


21:04:15.190 [INFO ] [runtime.busevents             :26   ] - Elevation state updated to -38.53
21:04:15.192 [TRACE] [i.i.InfluxDBPersistenceService:409  ] - found fractional part
21:04:15.193 [TRACE] [i.i.InfluxDBPersistenceService:187  ] - storing Elevation in influxdb -38.53
21:04:15.263 [INFO ] [runtime.busevents             :26   ] - Azimuth state updated to 285.94
21:04:15.264 [TRACE] [i.i.InfluxDBPersistenceService:409  ] - found fractional part
21:04:15.264 [TRACE] [i.i.InfluxDBPersistenceService:187  ] - storing Azimuth in influxdb 285.94
gerrieg commented 9 years ago

I can't see busevents for the shutters, only for Azimuth and Elevation. Can you open/close a shutter and see, if busevents are displayed?

itn3rd77 commented 9 years ago

Solved! It was all my fault - as usually the problem sits in front of the computer :-)

Thanks so much Gerhard for your help (pointing me in the right direction) and sorry for blaming your binding (Mea culpa)!

Background: I am running openHAB inside a Docker container (as every service on my home server) and the callback port 9123 was not properly routed to my container. So every event I manually triggered was received and got persisted (e.g. opening the rollershutters) but updates triggered from the devices e.g. temperature updates never reached openhab.

Regards

Ingo

gerrieg commented 9 years ago

No problem, the main thing is that it works now.

btw, which ui do you use for the charts? Looks good.

itn3rd77 commented 9 years ago

I am using Grafana for charting. Really really cool and no dependencies. Unfortunately not usable with MySQL thats why I am using InfluxDB which designed from ground up as a time series database.