{"id":48927190,"url":"https://github.com/hareeshmu/solarman","last_synced_at":"2026-04-17T07:04:48.532Z","repository":{"id":200581714,"uuid":"488691861","full_name":"hareeshmu/solarman","owner":"hareeshmu","description":"Retrieve current Solar PV data from the Solarman API and publish to mqtt","archived":false,"fork":false,"pushed_at":"2022-05-05T08:32:58.000Z","size":35,"stargazers_count":15,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-11T22:45:15.047Z","etag":null,"topics":["amd","arm64","armv7","docker-compose","docker-image","raspberry-pi","self-hosted","solarman","solarmanpv"],"latest_commit_sha":null,"homepage":"https://github.com/hareeshmu/solarman","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hareeshmu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["hareeshmu"]}},"created_at":"2022-05-04T17:55:56.000Z","updated_at":"2024-04-09T18:31:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0125a9c-d03f-4ace-97d3-4ba2b398ca10","html_url":"https://github.com/hareeshmu/solarman","commit_stats":null,"previous_names":["hareeshmu/solarman"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hareeshmu/solarman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hareeshmu%2Fsolarman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hareeshmu%2Fsolarman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hareeshmu%2Fsolarman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hareeshmu%2Fsolarman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hareeshmu","download_url":"https://codeload.github.com/hareeshmu/solarman/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hareeshmu%2Fsolarman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31918841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amd","arm64","armv7","docker-compose","docker-image","raspberry-pi","self-hosted","solarman","solarmanpv"],"created_at":"2026-04-17T07:04:48.364Z","updated_at":"2026-04-17T07:04:48.512Z","avatar_url":"https://github.com/hareeshmu.png","language":"Python","funding_links":["https://github.com/sponsors/hareeshmu"],"categories":[],"sub_categories":[],"readme":"# ⚡ solarman\n\n![Solarman Workflow](https://github.com/hareeshmu/solarman/actions/workflows/image.yml/badge.svg)  [![solarman docker image size](https://img.shields.io/docker/image-size/hareeshmu/solarman?style=flat-square)](https://hub.docker.com/r/hareeshmu/solarman \"solarman docker image size\")  [![Total DockerHub pulls](https://img.shields.io/docker/pulls/hareeshmu/solarman?style=flat-square)](https://hub.docker.com/r/hareeshmu/solarman \"Total DockerHub pulls\")\n\nScript to retrieve current Solar PV data from the Solarman API, and send Power (W) and Energy (kWh) metrics to a MQTT broker, for further use in home automation. Several PV vendors use the Solarman Smart platform for statistics, like sofar inverter with logger.\n\n```lang=bash\nusage: solarman.py [--repeat]\n\nCollect data from Solarman API\n\noptional arguments:\n--repeat                       Repeat at every interval defined in the config\n```\n\n## Usage\n\nYou can run this script as a Docker container or in Python 3. Either way a configuration file is required. See the sample `config.sample.json` file in this repository for reference. Also, a Solarman API appid and secret is required, which can be requested via \u003cmailto:service@solarmanpv.com\u003e.\n\n### Using Docker\n\nSupported platforms:\n\n* linux/amd64\n* linux/386\n* linux/arm/v7\n* linux/arm/v6\n* linux/arm64\n\nDocker example to run this script every 5 minutes and providing a config file:\n\n```lang=bash\ncd /opt\ngit clone https://github.com/hareeshmu/solarman\ncd solarman\nmv config.sample.json config.json # setup your config\nsudo docker run --name solarman -d --restart unless-stopped -v /YOUR/PATH/HERE/config.json:/config.json hareeshmu/solarman:latest\n```\n\n### Using docker-compose\n\nThis `docker-compose.yml` example can be used with docker-compose or podman-compose\n\n```lang=yaml\nversion: \"3.7\"\nservices:\n  solarman:\n    image: hareeshmu/solarman:latest\n    container_name: solarman\n    environment:\n      - PUID=1000\n      - PGID=1000\n    volumes:\n      - /YOUR/PATH/HERE/config.json:/config.json\n    restart: unless-stopped\n```\n\n### Using Python\n\nRun `pip install -r requirements.txt` and start `python3 solarman.py`.\n\nRun `pip install -r requirements.txt` and start `python3 solarman.py --repeat`.\n\n## MQTT topics\n\n### Station (Plant)\n\n```lang=bash\nsolarmanpv/station/batteryPower\nsolarmanpv/station/batterySoc\nsolarmanpv/station/chargePower\nsolarmanpv/station/dischargePower\nsolarmanpv/station/generationPower\nsolarmanpv/station/gridPower\nsolarmanpv/station/irradiateIntensity\nsolarmanpv/station/lastUpdateTime\nsolarmanpv/station/purchasePower\nsolarmanpv/station/usePower\nsolarmanpv/station/wirePower\n```\n\n### Inverter\n\n```lang=bash\nsolarmanpv/inverter/deviceId\nsolarmanpv/inverter/deviceSn\nsolarmanpv/inverter/deviceState\nsolarmanpv/inverter/deviceType\n\nsolarmanpv/inverter/attributes # contains all inverter datalist entries.\n```\n\n#### Inverter Attributes\n\n```lang=bash\nSN: XXXXXXXXXX\nDevice_Type: 4\nProduction_Compliance_Type: 0\nRated_Power: 300.00\nYear: 48\nMonth: 0\nDay: 0\nHour: 0\nMinute: 0\nSeconds: 0\nCommunication_Protocol_Version: V0.2.0.1\nControl_Board_Firmware_Version: V0.1.1.2\nCommunication_Board_Firmware_Version: V0.2.0.7\nDC_Voltage_PV1: 0.00\nDC_Voltage_PV2: 0.00\nDC_Voltage_PV3: 0.00\nDC_Voltage_PV4: 0.00\nDC_Current_PV1: 0.00\nDC_Current_PV2: 0.00\nDC_Current_PV3: 0.00\nDC_Current_PV4: 0.00\nDC_Power_PV1: 0.00\nDC_Power_PV2: 0.00\nDC_Power_PV3: 0.00\nDC_Power_PV4: 0.00\nAC_Voltage_1: 0.00\nAC_Current_1: 0.00\nTotal_AC_Output_Power(Active): 0\nAC_Output_Frequency_1: 0.00\nTotal_Production(Active): 2.50\nTotal_Production_1: 2.50\nTotal_Production_2: 0.00\nTotal_Production_3: 0.00\nTotal_Production_4: 0.00\nDaily_Production(Active): 0.70\nDaily_Production_1: 0.70\nDaily_Production_2: 0.00\nDaily_Production_3: 0.00\nDaily_Production_4: 0.00\nAC_Radiator_Temp: -10.00\nMicro_Inverter_Port_1: XXXXXXXXXX-1\nMicro_Inverter_Port_2: XXXXXXXXXX-2\nMicro_Inverter_Port_3: XXXXXXXXXX-3\nMicro_Inverter_Port_4: XXXXXXXXXX-4\nNumber_Of_MPPT_Paths: 1\nNumber_Of_Phases: 1\nRunning_Status: 4\nOverfrequency_And_Load_Reduction_Starting_Point: 50.20\nIslanding Protection Enabled: Enable\nOverfrequency_And_Load_Reduction_Percentage: 44\nGFDI Enabled: Disable\nGrid-connected Standard: 0\nGrid Voltage_Upper_Limit: 275.00\nGrid Voltage_Lower_Limit: 180.00\nGrid Frequency_Upper_Limit: 52.00\nGrid Frequency_Lower_Limit: 47.50\nStart-up Self-checking Time: 60\n```\n\n### Logger (Collector)\n\n```lang=bash\nsolarmanpv/logger/deviceId\nsolarmanpv/logger/deviceSn\nsolarmanpv/logger/deviceState\nsolarmanpv/logger/deviceType\n\nsolarmanpv/logger/attributes # contains all logger datalist entries\n```\n\n#### Logger Attributes\n\n```lang=bash\nEmbedded_Device_SN: XXXXXXXXXX\nModule_Version_No: MW3_15_5406_1.35\nExtended_System_Version: V1.1.00.07\nTotal_running_time: 1\nOffset_time: 1634486607\nData_Uploading_Period: 5\nData_Acquisition_Period: 60\nMax._No._of_Connected_Devices: 1\nSignal_Strength: 100\nHeart_Rate: 120\nIV_Curve_Supported: 1\nBatch_Command_Supported: 1\nSupport_Reporting_Upgrading_Progress: 0\nAT+UPGRADE_Command_Supported: 255\nMethod_Of_Protocol_Upgrade: 255\n```\n\n## Home Assistant\n\n```lang=bash\nsensor:\n  - platform: mqtt\n    name: \"solarmanpv_station_generationPower\"\n    state_topic: \"solarmanpv/station/generationPower\"\n    unit_of_measurement: \"W\"\n    state_class: measurement\n```\n\nRepeat for every station topic needed.\n\n```lang=bash\nsensor:\n  - platform: mqtt\n    name: \"solarmanpv_inverter\"\n    state_topic: \"solarmanpv/inverter/deviceState\"\n    json_attributes_topic: \"solarmanpv/inverter/attributes\"\n    \n  - platform: mqtt\n    name: \"solarmanpv_logger\"\n    state_topic: \"solarmanpv/logger/deviceState\"\n    json_attributes_topic: \"solarmanpv/logger/attributes\"\n\n  - platform: template\n    sensors:\n      solarmanpv_inverter_device_state:\n        entity_id: sensor.solarmanpv_inverter\n        value_template: \u003e-\n          {% set mapper =  {\n              '1' : 'Online',\n              '2' : 'Failure',\n              '3' : 'Offline'} %}\n          {% set state =  states.sensor.solarmanpv_inverter.state %}\n          {{ mapper[state] if state in mapper else 'Unknown' }}\n         \n  - platform: template\n    sensors:\n      solarmanpv_logger_device_state:\n        entity_id: sensor.solarmanpv_logger\n        value_template: \u003e-\n          {% set mapper =  {\n              '1' : 'Online',\n              '2' : 'Failure',\n              '3' : 'Offline'} %}\n          {% set state =  states.sensor.solarmanpv_logger.state %}\n          {{ mapper[state] if state in mapper else 'Unknown' }}\n\n```\n\n### Templates\n\n```lang=bash\ntemplate:\n  - sensor:\n    - name: solarmanpv_inverter_dc_voltage_pv1\n      unit_of_measurement: 'V'\n      state: \"{{ state_attr('sensor.solarmanpv_inverter', 'DC_Voltage_PV1') }}\"\n      state_class: measurement\n  - sensor:\n    - name: solarmanpv_inverter_dc_current_pv1\n      unit_of_measurement: 'A'\n      state: \"{{ state_attr('sensor.solarmanpv_inverter', 'DC_Current_PV1') }}\"\n      state_class: measurement\n      \n  - sensor:\n    - name: solarmanpv_inverter_dc_power_pv1\n      unit_of_measurement: 'W'\n      state: \"{{ state_attr('sensor.solarmanpv_inverter', 'DC_Power_PV1') }}\"\n      state_class: measurement\n      \n  - sensor:\n    - name: solarmanpv_inverter_dc_power_pv1\n      unit_of_measurement: 'W'\n      state: \"{{ state_attr('sensor.solarmanpv_inverter', 'DC_Power_PV1') }}\"\n      state_class: measurement\n      \n  - sensor:\n    - name: solarmanpv_inverter_total_production_1\n      unit_of_measurement: 'kWh'\n      state: \"{{ state_attr('sensor.solarmanpv_inverter', 'Total_Production_1') }}\"\n      state_class: total_increasing\n      \n  - sensor:\n    - name: solarmanpv_inverter_daily_production_1\n      unit_of_measurement: 'kWh'\n      state: \"{{ state_attr('sensor.solarmanpv_inverter', 'Daily_Production_1') }}\"\n      state_class: total_increasing\n\n  - sensor:\n    - name: solarmanpv_inverter_ac_radiator_temp\n      unit_of_measurement: '°C'\n      state: \"{{ state_attr('sensor.solarmanpv_inverter', 'AC_Radiator_Temp') }}\"\n      state_class: measurement\n      \n  - sensor:\n    - name: solarmanpv_inverter_ac_voltage_1\n      unit_of_measurement: 'V'\n      state: \"{{ state_attr('sensor.solarmanpv_inverter', 'AC_Voltage_1') }}\"\n      state_class: measurement\n      \n  - sensor:\n    - name: solarmanpv_inverter_ac_current_1\n      unit_of_measurement: 'A'\n      state: \"{{ state_attr('sensor.solarmanpv_inverter', 'AC_Current_1') }}\"\n      state_class: measurement\n\n  - sensor:\n    - name: solarmanpv_inverter_ac_output_frequency_1\n      unit_of_measurement: 'Hz'\n      state: \"{{ state_attr('sensor.solarmanpv_inverter', 'AC_Output_Frequency_1') }}\"\n      state_class: measurement\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhareeshmu%2Fsolarman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhareeshmu%2Fsolarman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhareeshmu%2Fsolarman/lists"}