Modbus et Shelly EM Mini Gen4

Bonjour
Je veux remonter des infos d’un SHELLY EM Mini Gen4 et je cherche à utiliser Mymodbus pour cela.
Config : Luna V 4.6.2 / Mymodbus V 2026-10-16 dernière version stable
J’utilise une batterie Marstek Venus V3 et le template que j’ai trouvé fonctionne très bien.
J’ai compris qu’il fallait remonter peu de registres et donc je me suis limité à essayer de lire la fréquence du 230V qui alimente mon Shelly. La doc technique indique les registres 32016 et 32017. Devant l’impossibilité d’obtenir un quelconque résultat j’ai voulu en avoir le coeur net. J’ai donc essayé de lire ces registres avec Modbus Doctor et les infos remontent directement et les valeurs concordent avec l’affichage de la page web de l’équipement


Voici ce que je demande à l’équipement

et à partir de ce moment les requêtes « ne passent plus » c’est à dire que l’équipement ne répond plus quand je consulte le mode santé du plugin alors que les autres équipements répondent…

Qu’est ce qui « bloque »?

Bonjour,

Postez la configuration de l’équipement SVP.

Avec Modus doctor, vous lisez 2016 et 2017, pourquoi lire 32017 et 32018 avec MyModbus ?!
En plus la Doc dit 32016 et 32017… Je ne comprends pas votre choix.

Quels ont été vos autres essais ?

À+
Michel

Bonjour

Voici la config de l’équipement coté Jeedom


Sur l’équipement lui même, j’ai dévalidé tous les protocoles « inutiles » sauf Modbus bien entendu.

Je pense qu’il y a un décalage dans la documentation SHELLY
lorsqu’elle indique la fréquence à l’adresse 32016, il faut lire les registres 32017 et 32018.
C’est ce que je conclue après vérification avec le logiciel Chipkin Modbus Explorer et corroborée par Modbus Doctor



mais cela n’est pas votre souci…

N’EMPECHE QUE quelque soit la plage d’adresses que je cherche à lire avec les commandes du plugin, les requêtes n’aboutissent pas. Dès que je retire les commandes que j’ai créées, la communication redevient « normale ». (temps de rafraichissement est celui du dernier polling)
J’ai plutôt envie de « disculper » le Shelly puisque l’interrogation avec deux outils distincts présente des résultats cohérents et je ne peux pas mettre en cause le plugin qui fonctionne bien avec Marstek.
Cependant, je ne vois dans le plugin la notion d’offset qui est demandé dans les autres outils qui demande de préciser l’Offset, le nombre de registres à lire et la fonction 01 / 02 /03 04).

Je suis disposé à faire tous les tests possibles, voire à vous adresser le Shelly si nécessaire; j’aime aller jusqu’au bout des choses…
Très cordialement

Vous avez essayé de lire les registres 2016 et 2017 ?
Vous avez testé d’autres plages ? D’autres registres unitaires ?

Si rien ne fonctionne, désactivez l’autre équipement MyModbus, passez les log en debug et redémarrez le démon. Postez les log dans des balises de texte préformaté pour que ce soit lisible.

Tous les outils n’en demandent pas, avec MyModbus, vous êtes maitre de ce que vous faites.

C’est la valeur entre crochet pour une plage de registres

Bonjour Michel
Merci de vous intéresser à mon cas.
J’ai essayé beaucoup de combinaisons et aucune n’aboutit, qu’il s’agisse de contenu booléens ou d’autres valeurs…
Voici la config de l’équipement avant de relancer le démon (démoniaque), les autres équipements étant désactivés.

LOG MYMODBUS

[2026-10-28 08:14:03] DEBUG  mymodbus::deamon_start
[2026-10-28 08:14:03] DEBUG  mymodbus::deamon_stop
[2026-10-28 08:14:03] DEBUG  mymodbus::deamon_stop * $deamon_state nok
[2026-10-28 08:14:03] DEBUG  mymodbus::getDeamonLaunchable
[2026-10-28 08:14:03] DEBUG  mymodbus::getCompleteConfiguration
[2026-10-28 08:14:03] DEBUG  mymodbus::getEqConfiguration
[2026-10-28 08:14:03] DEBUG  mymodbus::getSocketPort
[2026-10-28 08:14:03] DEBUG  mymodbus::getCallbackUrl
[2026-10-28 08:14:03] DEBUG  mymodbus::deamon_start * Ligne de commande : /var/www/html/plugins/mymodbus/core/class/../../resources/venv/bin/python3 /var/www/html/plugins/mymodbus/resources/mymodbus/mymodbusd.py --loglevel 'debug' --socketport 55502 --callback 'http://127.0.0.1:80/plugins/mymodbus/core/php/jeemymodbus.php' --apikey 'd5iBqoQ0dNQy4sl55Zi1hQKMrjH10SR77xdx2JgkyGAnbsVYR1ME8G0fLd48n7CJ' --pid /tmp/jeedom/mymodbus/daemon.pid
[2026-10-28 08:14:03] INFO  mymodbus::deamon_start * Lancement du démon MyModbus
[2026-10-28 08:14:05] DEBUG  jeemymodbus.php: Premier message de test reçu
[2026-10-28 08:14:05] DEBUG  mymodbus::sendNewConfig
[2026-10-28 08:14:05] DEBUG  mymodbus::getCompleteConfiguration
[2026-10-28 08:14:05] DEBUG  mymodbus::getEqConfiguration
[2026-10-28 08:14:05] DEBUG  mymodbus::sendToDaemon * params = array (
'CMD' => 'newDaemonConfig',
'config' =>
array (
0 =>
array (
'id' => '63',
'name' => 'Shelly EM',
'eqProtocol' => 'tcp',
'eqRefreshMode' => 'polling',
'eqPolling' => '30',
'eqTimeout' => '5',
'eqWriteCmdCheckTimeout' => '0.5',
'eqRetries' => '3',
'eqFirstDelay' => '1',
'eqErrorDelay' => '1',
'eqAddr' => '192.168.1.50',
'eqPort' => '502',
'eqRegTest' => '0',
'cmds' =>
array (
0 =>
array (
'id' => '2034',
'name' => 'BOOLE1',
'type' => 'info',
'cmdDevID' => '1',
'cmdFctModbus' => '4',
'cmdFormat' => 'blob',
'cmdAddress' => '32013 [3]',
'cmdFrequency' => '1',
'cmdInvertBytes' => '0',
'cmdInvertWords' => '0',
'cmdInvertDWords' => '0',
'repeat' => '0',
),
1 =>
array (
'id' => '2033',
'name' => 'Overvoltage',
'type' => 'info',
'cmdDevID' => '1',
'cmdFctModbus' => 'fromBlob',
'cmdSourceBlob' => '2034',
'cmdFormat' => 'uint8',
'cmdAddress' => '32013',
'cmdFrequency' => '1',
'cmdInvertBytes' => '0',
'cmdInvertWords' => '0',
'cmdInvertDWords' => '0',
'repeat' => '0',
),
),
),
),
)
[2026-10-28 08:14:05] DEBUG  mymodbus::getSocketPort
[2026-10-28 08:14:05] DEBUG  mymodbus::deamon_info
[2026-10-28 08:14:05] DEBUG  mymodbus::getDeamonLaunchable
[2026-10-28 08:14:05] DEBUG  mymodbus::getCompleteConfiguration
[2026-10-28 08:14:05] DEBUG  mymodbus::getEqConfiguration
[2026-10-28 08:14:05] DEBUG  mymodbus::deamon_info * daemon_info = '{"log":"mymodbus","state":"ok","launchable":"ok"}'
[2026-10-28 08:14:06] DEBUG  jeemymodbus.php: $input *{"values":{"polling":{"value":30,"eqId":"63"},"2034":0,"cycle_ok":{"value":0,"eqId":"63"}}}* type: array
[2026-10-28 08:14:06] DEBUG  jeemymodbus.php: Mise à jour cmd 'Polling' -> new value: '30'
[2026-10-28 08:14:06] DEBUG  jeemymodbus.php: Mise à jour cmd 'BOOLE1' -> new value: '0'
[2026-10-28 08:14:06] DEBUG  jeemymodbus.php: Mise à jour cmd 'Cycle OK' -> new value: '0'
[2026-10-28 08:14:10] DEBUG  mymodbus::deamon_info
[2026-10-28 08:14:10] DEBUG  mymodbus::getDeamonLaunchable
[2026-10-28 08:14:10] DEBUG  mymodbus::getCompleteConfiguration
[2026-10-28 08:14:10] DEBUG  mymodbus::getEqConfiguration
[2026-10-28 08:14:10] DEBUG  mymodbus::deamon_info * daemon_info = '{"log":"mymodbus","state":"ok","launchable":"ok"}'
[2026-10-28 08:14:15] DEBUG  mymodbus::deamon_info
[2026-10-28 08:14:15] DEBUG  mymodbus::getDeamonLaunchable
[2026-10-28 08:14:15] DEBUG  mymodbus::getCompleteConfiguration
[2026-10-28 08:14:15] DEBUG  mymodbus::getEqConfiguration
[2026-10-28 08:14:15] DEBUG  mymodbus::deamon_info * daemon_info = '{"log":"mymodbus","state":"ok","launchable":"ok"}'

LOG MYMODBUS DAEMON

[2026-10-28 07:14:05] INFO  : Starting daemon (lib version 2.0.0) with log level: debug
[2026-10-28 07:14:05] DEBUG  : Writing PID 471438 to /tmp/jeedom/mymodbus/daemon.pid
[2026-10-28 07:14:05] INFO  : Listening on 127.0.0.1:55502
[2026-10-28 07:14:05] DEBUG  : Received new message on socket
[2026-10-28 07:14:05] INFO  : Send async started with a cycle of 0.5s
[2026-10-28 07:14:05] DEBUG  : Close connection
[2026-10-28 07:14:05] DEBUG  : MyModbusd: 'on_message' '''{'CMD': 'newDaemonConfig', 'config': [{'id': '63', 'name': 'Shelly EM', 'eqProtocol': 'tcp', 'eqRefreshMode': 'polling', 'eqPolling': '30', 'eqTimeout': '5', 'eqWriteCmdCheckTimeout': '0.5', 'eqRetries': '3', 'eqFirstDelay': '1', 'eqErrorDelay': '1', 'eqAddr': '192.168.1.50', 'eqPort': '502', 'eqRegTest': '0', 'cmds': [{'id': '2034', 'name': 'BOOLE1', 'type': 'info', 'cmdDevID': '1', 'cmdFctModbus': '4', 'cmdFormat': 'blob', 'cmdAddress': '32013 [3]', 'cmdFrequency': '1', 'cmdInvertBytes': '0', 'cmdInvertWords': '0', 'cmdInvertDWords': '0', 'repeat': '0'}, {'id': '2033', 'name': 'Overvoltage', 'type': 'info', 'cmdDevID': '1', 'cmdFctModbus': 'fromBlob', 'cmdSourceBlob': '2034', 'cmdFormat': 'uint8', 'cmdAddress': '32013', 'cmdFrequency': '1', 'cmdInvertBytes': '0', 'cmdInvertWords': '0', 'cmdInvertDWords': '0', 'repeat': '0'}]}], 'apikey': 'd5iBqoQ0dNQy4sl55Zi1hQKMrjH10SR77xdx2JgkyGAnbsVYR1ME8G0fLd48n7CJ', 'dt': '2026-10-28T08:14:05+01:00'}'''
[2026-10-28 07:14:05] INFO  : MyModbusd: Command 'newDaemonConfig' received from jeedom: sending the new config to all MyModbusClients
[2026-10-28 07:14:05] INFO  : MyModbusd: 'manage_new_config' Starting equipment 'Shelly EM' (id 63)
[2026-10-28 07:14:05] DEBUG  : Shelly EM: 'read_eqConfig' client params for Shelly EM: {'name': 'Shelly EM', 'timeout': 5.0, 'retries': 3.0, 'trace_connect': <bound method MyModbusBase.trace_connect_callback of <mymodbusclient.MyModbusClient object at 0x7f7c042490>>, 'port': 502, 'host': '192.168.1.50', 'framer': <FramerType.SOCKET: 'socket'>}
[2026-10-28 07:14:05] DEBUG  : Shelly EM: 'read_eqConfig' Modbus request for cmd id 2034: ReadInputRegistersRequest(dev_id=1, transaction_id=0, address=32013, count=3, bits=[], registers=[], status=1, retries=0)
[2026-10-28 07:14:05] DEBUG  : Shelly EM: 'connect' ModbusClient of Shelly EM = AsyncModbusTcpClient 192.168.1.50:502
[2026-10-28 07:14:05] INFO  : MyModbusd: Starting the task for the equipment 'Shelly EM'
[2026-10-28 07:14:05] DEBUG  : Shelly EM: 'read_downstream' launched
[2026-10-28 07:14:05] DEBUG  : MyModbusd: 'read_upstream' run for Shelly EM (id = 63)
[2026-10-28 07:14:05] DEBUG  : Connecting to 192.168.1.50:502.
[2026-10-28 07:14:05] DEBUG  : Connecting Shelly EM
[2026-10-28 07:14:05] DEBUG  : Connected to Shelly EM
[2026-10-28 07:14:05] DEBUG  : Shelly EM: 'trace_connect_callback' called with connected = True
[2026-10-28 07:14:05] DEBUG  : Shelly EM: connection opened
[2026-10-28 07:14:05] INFO  : Shelly EM: 'async_connect' first call
[2026-10-28 07:14:06] DEBUG  : Shelly EM: 'run_loop' launched in mode 'polling'
[2026-10-28 07:14:06] DEBUG  : Shelly EM: 'one_cycle_read' launched
[2026-10-28 07:14:06] DEBUG  : Shelly EM: 'one_cycle_read' treatment cmd_id = 2034
[2026-10-28 07:14:06] DEBUG  : Shelly EM: 'one_cycle_read'/BOOLE1: requesting read
[2026-10-28 07:14:06] DEBUG  : send: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x4 0x7d 0xd 0x0 0x3
[2026-10-28 07:14:06] DEBUG  : Shelly EM: 'add_change' launched with payload = {'values::polling': {'value': 30.0, 'eqId': '63'}}
[2026-10-28 07:14:06] DEBUG  : MyModbusd: Message received from MyModbusClient Shelly EM: {'add_change': {'values::polling': {'value': 30.0, 'eqId': '63'}}}
[2026-10-28 07:14:06] DEBUG  : recv: 0x0 0x1 0x0 0x0 0x0 0x3 0x1 0x84 0x2 extra data:
[2026-10-28 07:14:06] DEBUG  : Processing: 0x0 0x1 0x0 0x0 0x0 0x3 0x1 0x84 0x2
[2026-10-28 07:14:06] ERROR  : Shelly EM/BOOLE1: error during read request on device id 1, address 32013 -> ExceptionResponse(dev_id=1, function_code=132, exception_code=2)
[2026-10-28 07:14:06] DEBUG  : Shelly EM: 'add_change' launched with payload = {'values::2034': 0, 'values::cycle_ok': {'value': 0, 'eqId': '63'}}
[2026-10-28 07:14:06] DEBUG  : MyModbusd: Message received from MyModbusClient Shelly EM: {'add_change': {'values::2034': 0, 'values::cycle_ok': {'value': 0, 'eqId': '63'}}}
[2026-10-28 07:14:06] DEBUG  : Try sending to jeedom: {'values': {'polling': {'value': 30.0, 'eqId': '63'}, '2034': 0, 'cycle_ok': {'value': 0, 'eqId': '63'}}}
[2026-10-28 07:14:07] DEBUG  : Shelly EM: 'one_cycle_read' exit with error_or_exception = True
[2026-10-28 07:14:36] DEBUG  : Shelly EM: 'one_cycle_read' launched
[2026-10-28 07:14:36] DEBUG  : Shelly EM: 'one_cycle_read' treatment cmd_id = 2034
[2026-10-28 07:14:36] DEBUG  : Shelly EM: 'one_cycle_read'/BOOLE1: requesting read
[2026-10-28 07:14:36] DEBUG  : send: 0x0 0x2 0x0 0x0 0x0 0x6 0x1 0x4 0x7d 0xd 0x0 0x3
[2026-10-28 07:14:36] DEBUG  : recv: 0x0 0x2 0x0 0x0 0x0 0x3 0x1 0x84 0x2 extra data:
[2026-10-28 07:14:36] DEBUG  : Processing: 0x0 0x2 0x0 0x0 0x0 0x3 0x1 0x84 0x2
[2026-10-28 07:14:36] ERROR  : Shelly EM/BOOLE1: error during read request on device id 1, address 32013 -> ExceptionResponse(dev_id=1, function_code=132, exception_code=2)
[2026-10-28 07:14:36] DEBUG  : Shelly EM: 'add_change' launched with payload = {'values::2034': 0, 'values::cycle_ok': {'value': 0, 'eqId': '63'}}
[2026-10-28 07:14:36] DEBUG  : MyModbusd: Message received from MyModbusClient Shelly EM: {'add_change': {'values::cycle_ok': {'value': 0, 'eqId': '63'}}}
[2026-10-28 07:14:36] DEBUG  : Try sending to jeedom: {'values': {'cycle_ok': {'value': 0, 'eqId': '63'}}}
[2026-10-28 07:14:37] DEBUG  : Shelly EM: 'one_cycle_read' exit with error_or_exception = True
[2026-10-28 07:15:05] DEBUG  : Shelly EM: 'one_cycle_read' launched
[2026-10-28 07:15:05] DEBUG  : Shelly EM: 'one_cycle_read' treatment cmd_id = 2034
[2026-10-28 07:15:05] DEBUG  : Shelly EM: 'one_cycle_read'/BOOLE1: requesting read
[2026-10-28 07:15:05] DEBUG  : send: 0x0 0x3 0x0 0x0 0x0 0x6 0x1 0x4 0x7d 0xd 0x0 0x3
[2026-10-28 07:15:06] DEBUG  : recv: 0x0 0x3 0x0 0x0 0x0 0x3 0x1 0x84 0x2 extra data:
[2026-10-28 07:15:06] DEBUG  : Processing: 0x0 0x3 0x0 0x0 0x0 0x3 0x1 0x84 0x2
[2026-10-28 07:15:06] ERROR  : Shelly EM/BOOLE1: error during read request on device id 1, address 32013 -> ExceptionResponse(dev_id=1, function_code=132, exception_code=2)
[2026-10-28 07:15:06] DEBUG  : Shelly EM: 'add_change' launched with payload = {'values::2034': 0, 'values::cycle_ok': {'value': 0, 'eqId': '63'}}
[2026-10-28 07:15:06] DEBUG  : MyModbusd: Message received from MyModbusClient Shelly EM: {'add_change': {'values::cycle_ok': {'value': 0, 'eqId': '63'}}}
[2026-10-28 07:15:06] DEBUG  : Try sending to jeedom: {'values': {'cycle_ok': {'value': 0, 'eqId': '63'}}}
[2026-10-28 07:15:07] DEBUG  : Shelly EM: 'one_cycle_read' exit with error_or_exception = True
[2026-10-28 07:15:35] DEBUG  : Shelly EM: 'one_cycle_read' launched
[2026-10-28 07:15:35] DEBUG  : Shelly EM: 'one_cycle_read' treatment cmd_id = 2034
[2026-10-28 07:15:35] DEBUG  : Shelly EM: 'one_cycle_read'/BOOLE1: requesting read
[2026-10-28 07:15:35] DEBUG  : send: 0x0 0x4 0x0 0x0 0x0 0x6 0x1 0x4 0x7d 0xd 0x0 0x3
[2026-10-28 07:15:35] DEBUG  : recv: 0x0 0x4 0x0 0x0 0x0 0x3 0x1 0x84 0x2 extra data:
[2026-10-28 07:15:35] DEBUG  : Processing: 0x0 0x4 0x0 0x0 0x0 0x3 0x1 0x84 0x2
[2026-10-28 07:15:35] ERROR  : Shelly EM/BOOLE1: error during read request on device id 1, address 32013 -> ExceptionResponse(dev_id=1, function_code=132, exception_code=2)
[2026-10-28 07:15:35] DEBUG  : Shelly EM: 'add_change' launched with payload = {'values::2034': 0, 'values::cycle_ok': {'value': 0, 'eqId': '63'}}
[2026-10-28 07:15:35] DEBUG  : MyModbusd: Message received from MyModbusClient Shelly EM: {'add_change': {'values::cycle_ok': {'value': 0, 'eqId': '63'}}}
[2026-10-28 07:15:36] DEBUG  : Try sending to jeedom: {'values': {'cycle_ok': {'value': 0, 'eqId': '63'}}}
[2026-10-28 07:15:36] DEBUG  : Shelly EM: 'one_cycle_read' exit with error_or_exception = True
[2026-10-28 07:16:05] DEBUG  : Shelly EM: 'one_cycle_read' launched
[2026-10-28 07:16:05] DEBUG  : Shelly EM: 'one_cycle_read' treatment cmd_id = 2034
[2026-10-28 07:16:05] DEBUG  : Shelly EM: 'one_cycle_read'/BOOLE1: requesting read
[2026-10-28 07:16:05] DEBUG  : send: 0x0 0x5 0x0 0x0 0x0 0x6 0x1 0x4 0x7d 0xd 0x0 0x3
[2026-10-28 07:16:05] DEBUG  : recv: 0x0 0x5 0x0 0x0 0x0 0x3 0x1 0x84 0x2 extra data:
[2026-10-28 07:16:05] DEBUG  : Processing: 0x0 0x5 0x0 0x0 0x0 0x3 0x1 0x84 0x2
[2026-10-28 07:16:05] ERROR  : Shelly EM/BOOLE1: error during read request on device id 1, address 32013 -> ExceptionResponse(dev_id=1, function_code=132, exception_code=2)
[2026-10-28 07:16:05] DEBUG  : Shelly EM: 'add_change' launched with payload = {'values::2034': 0, 'values::cycle_ok': {'value': 0, 'eqId': '63'}}
[2026-10-28 07:16:05] DEBUG  : MyModbusd: Message received from MyModbusClient Shelly EM: {'add_change': {'values::cycle_ok': {'value': 0, 'eqId': '63'}}}
[2026-10-28 07:16:06] DEBUG  : Try sending to jeedom: {'values': {'cycle_ok': {'value': 0, 'eqId': '63'}}}
[2026-10-28 07:16:06] DEBUG  : Shelly EM: 'one_cycle_read' exit with error_or_exception = True

Bonne réception

Cordialement

Il manquait cela.


Remplacez 32013 par 2013
Et pour tous les regsitres 3xxxx juste xxxx.

source : EM1 | Shelly Technical Documentation

Bonjour Michel

Merci pour cette réponse. Je ne savais pas trop comment prendre la chose, à savoir s’il fallait indiquer l’adresse AVEC ou SANS offset. En me basant sur l’équipement Marstek Venus, les adresses sont en 3xxxx. J’avais bien la doc Shelly sous les yeux… Sans doute une forêt cachée derrière un arbre. Merci Beaucoup.