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.

Process incoming JSON-RPC requests in Python

August 16, 2021: Version 5 has been released. Read about the changes in version 5, or read the full documentation. Version 5 is for Python 3.8+ only.

Exploding Labs 156 Dec 31, 2022
FramIp - it a framework for work at IP and domain

FramIp FramIp - it a framework for work with IP and domain Installation (termux) $ pkg install git && pkg install python && git clone https://github.c

1 Jan 28, 2022
A light-weight open-source project CLI utility for showing services running on ports in a host

Portable Port Scanner (ppscanner) Portable Port Scanner (ppscanner) is a light-weight open-source CLI utility that leverages on nmap to make quick and

1 Oct 30, 2021
GitHub action for sspanel automatically checks in to get free traffic quota

SSPanel_Checkin This is a dish chicken script for automatic check-in of sspanel for GitHub action, It is only applicable when there is no verification

FeedCatWithFish 7 Apr 28, 2022
A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.

A Python library to utilize AWS API Gateway's large IP pool as a proxy to generate pseudo-infinite IPs for web scraping and brute forcing.

George O 929 Jan 01, 2023
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
stellar-add-guest is a small tool to generate a new guest for Stellar Wireless (Enterprise mode) in OmniVista 2500 hosted on OmniSwitch with AOS Release 8

stellar-add-guest is a small tool to generate a new guest for Stellar Wireless (Enterprise mode) in OmniVista 2500 hosted on OmniSwitch with AOS Release 8.

BennyE 3 Jan 24, 2022
Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect

wifi-password Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect. Works on macOS and Li

Siddharth Dushantha 2.6k Jan 05, 2023
Simulate Attacks With Mininet And Hping3

Miniattack Simulate Attacks With Mininet And Hping3 It measures network load with bwm-ng when the net is under attack and plots the result. This demo

Geraked 3 Oct 03, 2022
IPE is a simple tool for analyzing IP addresses. With IPE you can find out the server region, city, country, longitude and latitude and much more in seconds.

IPE is a simple tool for analyzing IP addresses. With IPE you can find out the server region, city, country, longitude and latitude and much more in seconds.

Paul 0 Jun 11, 2022
Apple Store Stock Notifier monitors the availability of selected Apple devices in selected Apple stores, and sends you a notification when devices are available!

Apple Store Stock Notifier This software will immediately send you a notification via Telegram when one of your coveted Apple Devices is available in

Floris-Jan Willemsen 25 Dec 05, 2022
DEMO SOCKET AF INET SSL PYTHON

DEMO_SOCKET_AF_INET_SSL_PYTHON Python demo of socket family as AF_INET using TCP with SSL. Compatibility : macOS & GNU/Linux Network Topology style :

Enola 1 Jan 24, 2022
Multi-path load balancing is a method used by most of the real-time network to split the packets into different paths rather than transferring it through a single path

Multipath-Load-Balancing Method of managing incoming traffic by distributing and sharing load fairly among multiple routes from source to destination

Dharshan Kumar 6 Dec 10, 2022
DNS monitoring system built with Python.

DNS monitoring system built with Python.

Andressa Cabistani 7 Sep 28, 2021
Simple python script for automated network scans with random name generator(useful for CTF boxes).

📄 Automated NMAP script Description Simple python script for automated network scans with random name generator(useful for CTF boxes). Requirements 1

Dhmos Funk 2 Oct 29, 2021
Python port of proxy-www (https://github.com/justjavac/proxy-www)

proxy-www.py Python port of proxy-www (https://github.com/justjavac/proxy-www). Implemented additional functionalities! How to install pip install pro

Minjun Kim (Lapis0875) 20 Dec 08, 2021
gRPC typing stubs for Python

gRPC Typing Stubs for Python This is a PEP-561-compliant stub-only package which provides type information of gRPC. Install using pip: pip install grp

Blake Williams 27 Dec 20, 2022
A p2p chat app for zephyr

A p2p chat app for zephyr

L3gacy B3ta 4 Jun 02, 2021
Exfiltrate files using the HTTP protocol version ("HTTP/1.0" is a 0 and "HTTP/1.1" is a 1)

http-protocol-exfil Use the HTTP protocol version to send a file bit by bit ("HTTP/1.0" is a 0 and "HTTP/1.1" is a 1). It uses GET requests so the Blu

Ricardo Ruiz 23 Apr 30, 2022
Fast and configurable script to get and check free HTTP, SOCKS4 and SOCKS5 proxy lists from different sources and save them to files

Fast and configurable script to get and check free HTTP, SOCKS4 and SOCKS5 proxy lists from different sources and save them to files. It can also get geolocation for each proxy and check if proxies a

Almaz 385 Dec 31, 2022