serkri / SmartEVSE-3

Smart Electric Vehicle Charging Station (EVSE)
MIT License
67 stars 28 forks source link

Mains info not showing over MQTT #196

Closed hmmbob closed 11 months ago

hmmbob commented 11 months ago

Running 1.7.3, the mains info seems to not get published for some reason. I am feeding the mains details over API (http post).

image

Mqtt explorer shows that the data isn't published to the broker: image

Raw JSON:

{
   "version":"SERKRI-1.7.3",
   "mode":"OFF",
   "mode_id":0,
   "car_connected":true,
   "wifi":{
      "status":"WL_CONNECTED",
      "ssid":"xxx",
      "rssi":-53,
      "bssid":"D8:47:32:F4:08:AC",
      "auto_connect":false,
      "auto_reconnect":true
   },
   "evse":{
      "temp":30,
      "temp_max":65,
      "connected":true,
      "access":false,
      "mode":1,
      "loadbl":0,
      "pwm":1024,
      "solar_stop_timer":0,
      "state":"Ready to Charge",
      "state_id":0,
      "error":"None",
      "error_id":0,
      "rfid":"Ready to read card"
   },
   "settings":{
      "charge_current":0,
      "override_current":0,
      "current_min":6,
      "current_max":32,
      "current_main":25,
      "solar_max_import":0,
      "solar_start_current":5,
      "solar_stop_time":3,
      "enable_C2":"Not present",
      "modem":"Not present",
      "mains_meter":"API",
      "starttime":0,
      "stoptime":0,
      "repeat":0
   },
   "mqtt":{
      "host":"192.168.xx.xx",
      "port":1883,
      "topic_prefix":"SmartEVSE-11469",
      "username":"xxx",
      "password_set":true,
      "status":"Connected"
   },
   "home_battery":{
      "current":0,
      "last_update":0
   },
   "ev_meter":{
      "description":"Eastron3P",
      "address":11,
      "import_active_power":0,
      "total_kwh":543,
      "charged_kwh":0,
      "currents":{
         "TOTAL":0,
         "L1":0,
         "L2":0,
         "L3":0
      },
      "import_active_energy":543,
      "export_active_energy":0
   },
   "mains_meter":{
      "import_active_energy":0,
      "export_active_energy":0
   },
   "phase_currents":{
      "TOTAL":10,
      "L1":10,
      "L2":0,
      "L3":0,
      "last_data_update":1691516795,
      "charging_L1":false,
      "charging_L2":false,
      "charging_L3":false,
      "original_data":{
         "TOTAL":10,
         "L1":10,
         "L2":0,
         "L3":0
      }
   },
   "backlight":{
      "timer":0,
      "status":"OFF"
   }
}
dingo35 commented 11 months ago

Yep, look at the release notes of 1.7.3: currents fed via EM_API are no longer republished.

hmmbob commented 11 months ago

Ah, I did not link that to this issue.

But... Why? I am http-posting them to the SmartEVSE for a small ESP, and not to any other system. Now I am lacking this info, and particularly: I'd like to see what the evse is working with.

hmmbob commented 11 months ago

In addition to the above question: the topics still get announced anyway (discovery).

But I actually hope that you want to reconsider the removal, I don't understand why it was removed in the first place?

dingo35 commented 11 months ago

I asked for a use case here #192 and nobody responded. So I would expect, once you transistion to MQTT, you would feed your SmartEVSE though MQTT too; and then your clients can subscribe to the source directly, without delays, and without burdening the SmartEVSE with relay tasks....

hmmbob commented 11 months ago

Never saw your edit there, only the original message (email updates only send the original).

But publishing them over MQTT would mean that I need to add MQTT to the esp device plugged into the P1 port, burdening that device again.

And the use case wouldn't be strictly relay by the way, it's simply keeping track of what the smartevse is using for its SMART mode calculations. But I guess I could do that on the device as well, I'm not using the data for anything else.

(Still wondering why the data is being consumed by the HA integration then?)

hmmbob commented 11 months ago

Oh, and the reason for feeding over http.post instead of MQTT: it's one link in the chains less. Http.post goes directly from P1 esp to SmartEVSE, for MQTT there's the broker in between (which impacts SmartEVSE workings if I restart/update the broker during charging for instance).

dingo35 commented 11 months ago

Solved by 373adf94c2b9f0ac221