Johanbos / home-assistant-import

Home Assisant Import
MIT License
23 stars 1 forks source link

One device in Domoticz to multiple sensors in HA #291

Closed roblomq closed 3 months ago

roblomq commented 3 months ago

I have 2 questions.

1) When I run the query to find out the Id of the sensor in HA I find the sensors below.

167 sensor.slimme_meter_energieverbruik_tarief_1    kWh NULL    269.722 0.0
168 sensor.slimme_meter_energieverbruik_tarief_2    kWh NULL    214.6   0.32399999999998386
169 sensor.slimme_meter_energieproductie_tarief_1   kWh NULL    121.748 0.0
170 sensor.slimme_meter_energieproductie_tarief_2   kWh NULL    268.833 0.0
171 sensor.gas_meter_gasverbruik    m³  NULL    69.943  0.0
172 sensor.slimme_meter_energieverbruik_tarief_1_cost   EUR NULL    0.0 0.0
173 sensor.slimme_meter_energieverbruik_tarief_2_cost   EUR NULL    0.0 0.0750531600000011
174 sensor.slimme_meter_energieproductie_tarief_1_comp ...  EUR NULL    0.0 0.0
175 sensor.slimme_meter_energieproductie_tarief_2_comp ...  EUR NULL    0.0 0.0
176 sensor.gas_meter_gasverbruik_cost   EUR NULL    0.0 0.0

But how do I export my single domoticz device to multiple HA devices?

2) Do I really have to ad the almost 3500 lines one by one?

roblomq commented 3 months ago

Just realized I asked 2 stupid questions.... after thining a bit more I was able to answer both of the above questions. Thanks anyway :-)

Johanbos commented 3 months ago

This is why I love GitHub 🤓. Good luck with importing your data!

To be helpful for other users:

  1. One device has to be mapped to one sensor. The tool does not ‘split data’.
  2. The textarea in the sql extension allows running queries in bulk.
roblomq commented 3 months ago

Correct, the main cause was that the "Select an entity to import." is not on alfabethical order (probably on IDX) and therefore I saw only one deviceand didn't noticed the devices I needed where far lower on the list. Second, on the script it says "Run all the queries one by one." but I red it sort of as "Run all the lines one by one.".

Thanks for your tool, worked perfectly fine further.

Also maybe some extra tip: In HA go to "Developer tools", click on the "Statistics" tab and search for the recently imported data and click on the "graph" symbol on the far right. Then click on "Peaks" (not 100% sure this is the correct englisch term because mine is on dutch), then you see the exeptional values. This is a simple check to see if there where some import errors, then there you can correct the value.

image