mchwalisz / home-assistant-senec

SENEC Battery integration for Home Assistant
Apache License 2.0
46 stars 23 forks source link

Wallbox #3

Open Bugstehude opened 4 years ago

Bugstehude commented 4 years ago

Is it possible to add the Data from the Senec Wallbox? The lala.cgi should altough deliver this data

mchwalisz commented 4 years ago

It should be possible but I do not own it, so it will be much harder to test.

Would you be able to provide me API responses?

Bugstehude commented 4 years ago

Hi here is the Request where you can see the Structure.

curl http://xxx/lala.cgi -H 'Content-Type: application/json' -d '{"WALLBOX":{"APPARENT_CHARGING_POWER":"","MAX_TOTAL_CURRENT_BY_GRID":"","L1_USED":"","L2_USED":"","L3_USED":"","EV_CONNECTED":""} }}'

RESULT:

{"WALLBOX":{"APPARENT_CHARGING_POWER":["fl_00000000","fl_00000000","fl_00000000","fl_00000000"],"MAX_TOTAL_CURRENT_BY_GRID":"fl_00000000","L1_USED":["u8_00","u8_00","u8_00","u8_00"],"L2_USED":["u8_00","u8_00","u8_00","u8_00"],"L3_USED":["u8_00","u8_00","u8_00","u8_00"],"EV_CONNECTED":["u8_00","u8_00","u8_00","u8_00"]}}

I Think the first respond is the summary and the 2-4 Respond are the variable for Wallbox 1 to 3. I Think for the most people is Response 1 enough.

if you go to http://Senec-IP/vars.html you can see all possible Variables. Section is the first part (here Wallbox) and variable is the variable ;) I Think the variables select in the statement above should be enough.

I can test it if you wish.

Smart4Home commented 3 years ago

Hi I am also interested in adding the Senec Wallbox and would help in testing. The Curly Data looks similarly identical. But i´ll post ist anyway.

I'd appreciate if you implement these feature.

curl http://SENEC_IP/lala.cgi -H 'Content-Type: application/json' -d '{"WALLBOX":{"APPARENT_CHARGING_POWER":"","MAX_TOTAL_CURRENT_BY_GRID":"","L1_USED":"","L2_USED":"","L3_USED":"","L1_CHARGING_CURRENT":"","L2_CHARGING_CURRENT":"","L3_CHARGING_CURRENT":"","EV_CONNECTED":"","MIN_CHARGING_CURRENT":""} }}'

{"WALLBOX":{"APPARENT_CHARGING_POWER":["fl_46125447","fl_00000000","fl_00000000","fl_00000000"],"MAX_TOTAL_CURRENT_BY_GRID":"fl_00000000","L1_USED":["u8_01","u8_00","u8_00","u8_00"],"L2_USED":["u8_01","u8_00","u8_00","u8_00"],"L3_USED":["u8_01","u8_00","u8_00","u8_00"],"L1_CHARGING_CURRENT":["fl_414B3333","fl_00000000","fl_00000000","fl_00000000"],"L2_CHARGING_CURRENT":["fl_4161999A","fl_00000000","fl_00000000","fl_00000000"],"L3_CHARGING_CURRENT":["fl_415E6666","fl_00000000","fl_00000000","fl_00000000"],"EV_CONNECTED":["u8_01","u8_00","u8_00","u8_00"],"MIN_CHARGING_CURRENT":["fl_40C00000","fl_41000000","fl_00000000","fl_00000000"]}}

JoJa1101 commented 3 years ago

I am also interested in adding the SENEC Wallbox.

@mchwalisz Hey Mikołaj, are you also interested in implementing the wallbox into your integration?

Regards

guevara777 commented 3 years ago

this is a great integration for my senec home. Thank you very much. would love to see wallbox integrated in the future! Good Work!

klaus1956 commented 3 years ago

I think the problem is that there are 2 differennt ways of WB integration:

mchwalisz commented 2 years ago

I'd be interested in adding wallbox into the integration. I can try to add simple sensors based on my unit (without wallbox) and the output above.

On the other hand and looking at the link above, I will not be able to do anything more. I'd be glad to accept PR with the changes from someone having wallbox and showing the integration.

Kippschalter commented 2 years ago

Thank you for your home Assistant integration of the SENEC battery. Great work! THANK YOU! Unfortunately I am still struggling with the integration of the new Energy functionality. The entity is not configured ?!? I will get that out too ;-) I would also be interested in the Wallbox integration and am available for testing with limited programming skills ;-)

JoJa1101 commented 2 years ago

Thank you for your home Assistant integration of the SENEC battery. Great work! THANK YOU! Unfortunately I am still struggling with the integration of the new Energy functionality. The entity is not configured ?!? I will get that out too ;-) I would also be interested in the Wallbox integration and am available for testing with limited programming skills ;-)

Read this first: https://github.com/mchwalisz/home-assistant-senec/issues/12#issuecomment-947525338

Regards

schimi42 commented 2 years ago

I submitted a pull request to both pysenec and home-assistant-senec to enable the basic wallbox data.

Basti-Fantasti commented 1 year ago

I'd be available for wallbox testing as well...

Kuechenfenster commented 1 year ago

One more Wallbox tester here!!! Where to start?!

Basti-Fantasti commented 1 year ago

As the wallbox consumption not being available by default, I found a workaround solution for me using templates in Home Assistant

- platform: template
  sensors:
    wallbox_consumption:
      friendly_name: Wallbox
      value_template: >-
        {% if states('switch.mycar_charger') == 'on' %}
          {% set wbpower = states('sensor.senec_solar_generated_power') | float - states('sensor.senec_house_power') | float + states('sensor.senec_grid_state_power') | float%} 
        {%else%}
          {%set wbpower = 0 %}
        {%endif%}  
        {{wbpower}}
      unit_of_measurement: "W"

Basically I check, if my car is connected to the wallbox. I do this using the custom Tesla integration. Then I take the "actual generated power" - "house power usage" + "exported power to grid"

e.g.

actual_generated = 18000W house_consumption = 300W exported = -7000W

wbpower = 18000-300+(-7000) = 10700W

if the car is not connected I always output 0W in principle the connected car can also be detected by measuring the resulting value as shown above and set a threshold to e.g. for a Tesla to the minimum charing rate of 5A * 3 * 220V = 3300W. So wbpower_value > 3000W could toggle car present on or off. This should also work when no power is generated but only imported from grid

actual_generated = 0W house_consumption = 300W exported = 7000W

wbpower = 0-300+7000) = 6700W