Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Sofar2MQTT Help

  • 02-09-2023 7:03pm
    #1
    Registered Users, Registered Users 2 Posts: 439 ✭✭


    All,

    I setup the Sofar2MQTT hardware, and when I look at the MQTT plugin in HA and listen to all #, I see the following (indicating that the hardware is successfully connected to the MQTT broker).

    Message 1 received on Sofar2MQTT/state at 7:56 PM:{
        "uptime": 9319996,
        "deviceName": "Sofar2MQTT",
        "running_state": 2,
        "inverter_temp": 48,
        "inverter_HStemp": 36,
        "grid_freq": 49.98,
        "inverter_power": 740,
        "grid_power": 30,
        "grid_voltage": 237.7,
        "consumption": 750,
        "solarPV1Volt": 225.8,
        "solarPV1Current": 0.13,
        "solarPV1": 0,
        "solarPV2Volt": 220.2,
        "solarPV2Current": 0.1,
        "solarPV2": 10,
        "solarPV": 0,
        "battery_voltage": 52.7,
        "battery_current": -14.2,
        "battery_power": -720,
        "battery_temp": 24,
        "batterySOC": 96,
        "batterySOH": 100,
        "battery_cycles": 65394,
        "today_generation": 19.78,
        "total_generation": 3791.2,
        "today_consumption": 15.46,
        "total_consumption": 5333.3,
        "today_purchase": 1.03,
        "total_purchase": 3187.1,
        "today_exported": 14.05,
        "total_exported": 2893.8,
        "today_charged": 16.99,
        "total_charged": 1459.2,
        "today_discharged": 11.2,
        "total_discharged": 1333.1,
        "working_mode": 0
    }
    

    My issue is I don't know how to create sensors in Ha and connect this MQTT feed into that.

    I looked at https://gitlab.com/rjpearce/sofar2mqtt repo, and while the instructions are very detailed, I don't have the PI in the middle as my hardware is leveraging the ESP32 setup.

    I'm missing a piece between getting the hardware setup and sensors created in HA. How do I get the sensors connected to the correct topic?



Comments

  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,260 Mod ✭✭✭✭Jonathan


    If it doesn't support autodiscovery (and it sounds like it doesn't), you'll need to create the sensors manually using yaml.




  • Registered Users, Registered Users 2 Posts: 439 ✭✭jasgrif11


    I changed the device's name to "sofar", and I see 48 entities showing up in HA as I included the YAML configurations from https://gitlab.com/rjpearce/sofar2mqtt. in my config file on HA.

    However all the sensors have a value of Unknown. I think its a minor issue, but stumped!




  • Registered Users, Registered Users 2 Posts: 8,073 ✭✭✭10-10-20


    Check Developer Tools for some of those entities and see if what "last changed" is listed.




  • Registered Users, Registered Users 2 Posts: 8,073 ✭✭✭10-10-20


    Actually, the sensor names in HA are being taken from the file "automations/mqtt-sofar-hyd-ep.yaml".


    Try look those up in the Developer Tool.



  • Registered Users, Registered Users 2 Posts: 439 ✭✭jasgrif11


    @10-10-20 I see a few entities where the state seems ok as in this example.

    However, most others are reading as Unknown. All would have come from the same Yaml file




  • Advertisement
  • Registered Users, Registered Users 2 Posts: 8,073 ✭✭✭10-10-20


    If the data is getting to MQTT but not into HA, then I'm not sure of the next steps as I don't use MQTT that much other than Zwave2MQTT, but that has a optional debug file.

    Any chance you're using this project and it doesn't support the entities that you're looking for?

    Subscribe your MQTT client to:
    Sofar2mqtt/state
    Which provides:
    
    running_state
     grid_voltage
     grid_current
     ...
    


  • Moderators, Home & Garden Moderators Posts: 6,636 Mod ✭✭✭✭graememk


    There's 2 variants of the sofar2mqtt! Something to watch out for.



  • Registered Users, Registered Users 2 Posts: 439 ✭✭jasgrif11


    Ok I finally got this working (mainly). Yes it was the cmcgerty version that I needed to use and I set everything up as JSON. I have a few questions that I hope others with experience can provide insight on.

    1. When in Self Use mode I have to set a value for charge/discharge. Is this normal behaviour?
    2. I read online that I should change to "Passive" mode sparingly. "warning: this register does not support frequent writes". I believe it has to do with the amount of writes to the EEPROM of the inverter. Is this true?
    3. There is however a "Passive Schedule Management mode" with the following options 0: Spontaneous self-use mode, 1: Manual mode, 2: Schedule mode. Has anyone enabled and used this? This essentially means that the inverter always runs in passive mode.

    I should outline my scenario. I want to be able to manage the charging time based on certain conditions. As an example: If EV is plugged into Zappi and SOC is less than 80% and it's after 12am and before 9am then charge car until SOC is 80%. Once car reaches 80% change Zappi mode to Stop. In parallel charge battery to 100% (during same time window). If the battery is at 100% and car is still charging then disable JKBMS discharge (so car doesn't pull from the battery). At 9am set inverter to Self Use and Zappi to Eco+

    That is just one scenario. I may look at different ones once I move to Smart Meter and on a different tariff.



  • Registered Users, Registered Users 2 Posts: 439 ✭✭jasgrif11


    Does anyone have a full list of topic queries that I can run with the cmcgerty version?

    In particular i’m trying to figure out sub topic commands for Time of Use mode.

    Rules:0 : Enabled

    Start Time

    End Time

    SOC

    Charge

    Effective Start Date

    Effective End Date

    Weekday Select

    I can enable Time of Use but can’t figure out how to set parameters

    Thanks

    Post edited by jasgrif11 on


Advertisement