Solismod - A script subscribes to MQTT topics and waits for a message

Related tags

Networkingsolismod
Overview

SolisMod

This is a first attempt to modify Solis inverter settings As SolisMon3, this is based on great work by jmccrohan

This script subscribes to MQTT topics and waits for a message. Once something(HomeAssistant, NodeRed) publishes to the subscribed topic, the script checks the register assigned to topic and reads the register from Solis inverter. If value stored in inverter is not the same as the one in published topic, the new value is sent to inverter.

Configuration

config.py

Modify the values in config.py to match your setup

INVERTER_SERIAL = 1234567890  # WiFi stick serial number
INVERTER_IP = "192.168.1.55"  # IP address of inverter
INVERTER_PORT = 8899          # Port number
MQTT_SERVER = "192.168.1.20"  # IP address of MQTT server
MQTT_PORT = 1883              # Port number of MQTT server
MQTT_USER = ""                # MQTT username, leave blank is no user
MQTT_PASS = ""                # MQTT password
DEBUG = True                  # Enable debugging, helpfull to diagnose problems

registers.py

Define the topic and matching register in registers.py file. TOPICS_REGS is a dictionary. The key(string) a topic you want to subscribe to, the value is a list with single member(integer) which is register you want to modify. I made value a list as I may add some more stuff in the future.
Here is the example: TOPICS_REGS = {"nodered/solis/minutes": [43004]} The script will subscribe to nodered/solis/minutes on MQTT server and this will be used to modify holding register 43004, which will set inverter clock minutes to desired value.

Running

Run main.py

Running in docker

Docker image is provided.
On your docker host create a folder solismod/config and copy your modified config.py and registers.py files in there.

docker run -it -d --restart unless-stopped --name solismod -v /solismod/config:/solismod/config nosireland/solismod

Docker Compose example

version: "3.4"

  solismod:
    image: nosireland/solismod:latest
    container_name: solismod
    restart: always
    mem_limit: 32m
    volumes:
      - /docker/solismod/config:/solismod/config
    logging:
      options:
        max-size: 5m

Testing

You can use different tools to publish to MQTT. Here is a simple example with NodeRed. I will use nodered/solis/minutes for topic.

  1. Change/Add config.py and registers.py values
  2. Start the script or docker container
  3. In NodeRed add Inject and MQTT out nodes. Connect them together
  4. Modify Inject node, give it a name('Minutes) and set payload value to the one you want inverter to be changed to(35)
    inject
  5. Modify MQTT out node. Select your MQTT server, if you have not configured one click on pen and configure it.
    Enter MQTT topic nodered/solis/minutes leave rest blank. mqtt_out
  6. Deploy your changes and you should see MQTT out node connected
    pub
  7. Once you click on Inject, the value(35) that you have set will be published to MQTT topic nodered/solis/minutes and since the script is subscribed to that topic, it will try to change the register assigned on the inverter.
    You should see the script showing something similar to below
    change

Important

This is a very early draft version and things might not work as expected. Feel free to ask questions.

A script to automatically update the github's proxy IP in hosts file.

updateHostsGithub A script to automatically update the github's proxy IP in hosts file. Now only Mac and Linux are supported. (脚本自动更新本地hosts文件,目前仅支持Ma

2 Jul 06, 2022
A Simple but Powerful cross-platform port scanning & and network automation tool.

DEDMAP is a Simple but Powerful, Clever and Flexible Cross-Platform Port Scanning tool made with ease to use and convenience in mind. Both TCP

Anurag Mondal 30 Dec 16, 2022
A simple hosts picker for Microsoft Services

A simple Python scrip for you to select the fastest IP for Microsoft services.

Konnyaku 394 Dec 17, 2022
EV: IDS Evasion via Packet Manipulation

EV: IDS Evasion via TCP/IP Packet Manipulation 中文文档 Introduction EV is a tool that allows you crafting TCP packets and leveraging some well-known TCP/

256 Dec 08, 2022
A tool which is capable of scanning ports as TCP & UDP and detecting open and closed ones.

PortScanner Scan All Open Ports Of The Target IP. A tool which is capable of scanning ports as TCP & UDP and detecting open and closed ones. Clone fro

Msf Nmt 17 Nov 26, 2022
A library of functions that can be used to manage the download of claims from the LBRY network.

lbrytools A library of functions that can be used to manage the download of claims from the LBRY network. It includes methods to download claims by UR

13 Dec 03, 2022
An automatic web reconnaissance tool written in python3.

WebRecon is an automatic web reconnaissance tool written in python3. Provides a command line interaction similar to msfconsole. The Exasmple.py file is provided, and you can write your own scripts yo

prophet 1 Feb 06, 2022
Tiny Interactive File Transfer Application

TIFTA: Tiny Interactive File Transfer Application This repository holds all the source code, tests and documentation of the TIFTA software. The main g

Jorge Martínez 2 Dec 08, 2021
Nexum is an open-source, remote administration tool written in Python 3

A full-featured remote administration tool written in Python 3. The goal of this project is to make the use of a remote administration tool as simple

z3phyrus 2 Nov 26, 2021
Medusa is a cross-platform agent compatible with both Python 3.8 and Python 2.7.

Medusa Medusa is a cross-platform agent compatible with both Python 3.8 and Python 2.7. Installation To install Medusa, you'll need Mythic installed o

Mythic Agents 123 Nov 09, 2022
List of ngrok alternatives and other ngrok-like tunneling software and services. Focus on self-hosting.

List of ngrok alternatives and other ngrok-like tunneling software and services. Focus on self-hosting.

Anders Pitman 7.3k Jan 03, 2023
Takes a file of hosts or domains and outputs the IP address of each host/domain in the file.

Takes a file of hosts or domains and outputs the IP address of each host/domain in the file. Installation $ git clone https://github.com/whoamisec75/i

whoami security 2 May 10, 2022
Build surface water network for MODFLOW's SFR Package

Surface water network Creates surface water network, which can be used to create MODFLOW's SFR. Python packages Python 3.6+ is required. Required geop

Mike Taves 20 Nov 22, 2022
Mass querying whois records using whois tool

Mass querying whois records using whois tool

Mohamed Elbadry 24 Nov 10, 2022
Using AWS's API Gateway + Lambda + Python to run a simple websocket application. For learning/testing

Using AWS's API Gateway + Lambda + Python to run a simple websocket application. For learning/testing. The AWS Resources seemed overly complex and were missing some critical gotchas in setting up a s

Seth Miller 15 Dec 23, 2022
IP Pinger - This tool allows you to enter an IP and check if its currently connected to a host

IP Pinger - This tool allows you to enter an IP and check if its currently connected to a host

invasion 3 Feb 18, 2022
Control your Puffco Peak Pro from your computer!

PuffcoPC Control your Puffco Peak Pro from your computer! Contributions Pull requests are welcome. For major changes, please open an issue first to di

Bryan Muschter 5 Nov 02, 2022
Scan any IP address except IPv6 using Python.

Port_Scanner-python To use this tool called "Console Port Scanner", you need to enter an IP address (NOT IPv6). It might take a long time to scan port

1 Dec 24, 2021
It's an extra broadcast driver for masonite. It adds support for socketio.

It's an extra broadcast driver for masonite. It adds support for socketio.

Yubaraj Shrestha 6 Feb 23, 2022
Geowifi 📡 💘 🌎 Search WiFi geolocation data by BSSID and SSID on different public databases.

Geowifi 📡 💘 🌎 Search WiFi geolocation data by BSSID and SSID on different public databases.

GOΠZO 441 Dec 23, 2022