SMS Brasil UPS - Add-on para Nobreaks!

Opa.

Quando tento iniciar o addon, não chega a gerar log.

Já no log do supervisor, tem warnning, mas de outro add-on.

eu vi que está listando 2 USB, mas ja tentei com as 2.

bachelddd@ha:~/smsUps$ ls /dev/ -l | grep ttyUSB*
crw-rw---- 1 root dialout 188, 0 Feb 2 10:50 ttyUSB0
crw-rw---- 1 root dialout 188, 1 Feb 1 20:54 ttyUSB1

Instalar ele está instalando… mas não roda. No log do homeassistant aparece algum erro?

Boa tarde Daniel.
Parabens pela iniciativa.
Estou tentando iniciar o seu ADD-ON, mas estou com o erro abaixo.

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Starting add-on container…
Fri Feb 18 12:18:25 -03 2022
Exporting config data
Getting mqqt data…
-rw------- 1 root root 357 Feb 18 12:18 options.json
-rw-r–r-- 1 root root 724 Feb 18 10:33 secrets.ini
pycache:
total 28
drwxr-xr-x 2 root root 4096 Feb 18 10:33 .
drwxr-xr-x 4 root root 4096 Feb 18 12:18 …
-rw-r–r-- 1 root root 236 Feb 18 10:33 comum.cpython-39.pyc
-rw-r–r-- 1 root root 11050 Feb 18 10:33 dmslibs.cpython-39.pyc
-rw-r–r-- 1 root root 1379 Feb 18 10:33 webserver.cpython-39.pyc
templates:
total 16
drwxr-xr-x 2 root root 4096 Feb 18 12:17 .
drwxr-xr-x 4 root root 4096 Feb 18 12:18 …
-rw-r–r-- 1 root root 718 Feb 18 12:17 base.html
-rw-r–r-- 1 root root 221 Feb 18 12:17 index.html
/data
Copying html templates…
total 16
drwxr-xr-x 2 root root 4096 Feb 18 12:18 .
drwxr-xr-x 4 root root 4096 Feb 18 12:18 …
-rw-r–r-- 1 root root 718 Feb 18 12:18 base.html
-rw-r–r-- 1 root root 221 Feb 18 12:18 index.html
PATH:
/data
MQTT_HOST - core-mosquitto
MQTT_PASS - ipeejooHaegh7Osheyiemeequ4yiPheeyev1ka7AethieZ2yop0UMoaW2Ahf4aej
[12:18:32] INFO: secrets.ini exists!
[12:18:32] INFO: /data/secrets.ini exists!
SMS BRASIL UPS - dmslabs
********** dmslabs smsUPS v.0.39j
Starting up… 2022-02-18 12:18:34
2022-02-18 12:18:34,662 - root - DEBUG - ********** dmslabs smsUPS v.0.39j
2022-02-18 12:18:34,662 - root - DEBUG - Starting up…
Path: /data
2022-02-18 12:18:34,663 - root - DEBUG - Path: /data
hassio_token:4ed79dde88fb425a5a3060582e5324b808829bf51e978f9ad3156d209d18dde0c8bb6882064c786a937dfa25b360c4118ccdffa4215feb1a
2022-02-18 12:18:34,663 - root - DEBUG - Running inside HASSIO True
2022-02-18 12:18:34,664 - root - DEBUG - env1:/dev/ttyUSB0
Getting Config Parser.
2022-02-18 12:18:34,665 - root - DEBUG - Existe secrets.ini
Existe secrets.ini
Reading secrets.ini
2022-02-18 12:18:34,669 - root - WARNING - Reading secrets.ini
2022-02-18 12:18:34,671 - root - DEBUG - Config: SMSUPS_FULL_POWER use default: 1450
Getting Config Parser.
2022-02-18 12:18:34,672 - root - DEBUG - Existe secrets.ini
Existe secrets.ini
2022-02-18 12:18:34,676 - root - DEBUG - Config: ALLOW_SHUTDOWN use default: True
2022-02-18 12:18:34,677 - root - DEBUG - Config: DEVELOPERS_MODE use default: False
False
2022-02-18 12:18:34,678 - root - DEBUG - PORTA secrets: /dev/tty.usbserial-1440/dev/tty.usbserial-1470/dev/ttyUSB0/devx/ttyUSB0
NORMAL MODE
IN HASS.IO
2022-02-18 12:18:34,679 - root - DEBUG - Loading env data…
false
Getting Config Parser.
2022-02-18 12:18:34,680 - root - DEBUG - Existe secrets.ini
Existe secrets.ini
2022-02-18 12:18:34,684 - root - DEBUG - Env data loaded.
2022-02-18 12:18:34,685 - root - DEBUG - PORTA substitui: /dev/ttyUSB0
2022-02-18 12:18:34,685 - root - DEBUG - SMSUPS_SERVER: True
2022-02-18 12:18:34,686 - root - DEBUG - SMSUPS_CLIENTE: False
2022-02-18 12:18:34,686 - root - DEBUG - MQTT_HOST: core-mosquitto
2022-02-18 12:18:34,687 - root - DEBUG - IP: 192.168.15.45
SMSUPS_SERVER: True
SMSUPS_CLIENTE: False
IP: 192.168.15.45
UPS_ID: 01
UPS_NAME: SMS
UPS_NAME_ID: ups_SMS_01
ALLOW_SHUTDOWN: False
2022-02-18 12:18:34,688 - root - INFO - os.name: posix
info / Error! Code: OSError, Message, unable to determine login name
2022-02-18 12:18:34,689 - root - DEBUG - info / Error! Code: OSError, Message, unable to determine login name
2022-02-18 12:18:34,690 - root - INFO - Starting MQTT core-mosquitto
2022-02-18 12:18:34,690 - root - DEBUG - mqttStart MQTT_PASSWORD: ipeejooHaegh7Osheyiemeequ4yiPheeyev1ka7AethieZ2yop0UMoaW2Ahf4aej
MQTT connected with result code 0
2022-02-18 12:18:34,697 - root - DEBUG - MQTT connected with result code 0
Connected to core-mosquitto
2022-02-18 12:18:34,698 - root - INFO - Subscribe Topic: home/ups/cmd
Subscribe Topic: home/ups/cmd
Porta: /dev/ttyUSB0 - True
2022-02-18 12:18:35,704 - root - INFO - Port /dev/ttyUSB0 - is open: True
2022-02-18 12:18:37,507 - root - DEBUG - cmd:Name / str: 49 ff ff ff ff bb 0d / Q: False
2022-02-18 12:18:39,215 - root - DEBUG - response: b’3a4e45542057494e4e45522020332e301b0d’
2022-02-18 12:18:39,216 - root - DEBUG - cmd:Info / str: 46 ff ff ff ff be 0d / Q: False
2022-02-18 12:18:40,923 - root - DEBUG - response: b’3b3131352f3232303030303031323630e20d’
2022-02-18 12:18:40,924 - root - DEBUG - UPS Info: NET WINNER 3.0e
/
2022-02-18 12:18:40,925 - root - DEBUG - UPS Info: NET WINNER 3.0e /
2022-02-18 12:18:40,927 - root - DEBUG - Sensor_dic: 0
2022-02-18 12:18:40,934 - root - WARNING - erro json.load:
{
“stat_t”: “home/ups_SMS_01/json”,
“name”: “SMS_01_inputVac”,
“uniq_id”: “SMS_01_inputVac”,
“val_tpl”: “{{ value_json.inputVac }}”,
“icon”: “mdi:transmission-tower-export”,
“device_class”: “voltage”,
“expire_after”: “360”,
“device”: { “name”: “NET WINNER 3.0e”,
“manufacturer”: “dmslabs”,
“model”: “”,
“sw_version”: “0.39j”,
“via_device”: “smsUPS”,
“identifiers”: [ “SMS_01” ] }
}
Traceback (most recent call last):
File “/data/…/smsUPS.py”, line 1561, in
send_hass()
File “/data/…/smsUPS.py”, line 1263, in send_hass
monta_publica_topico(k[0], sensor_dic[k[0]], varComuns)
File “/data/…/smsUPS.py”, line 1229, in monta_publica_topico
dados = json_remove_vazio(dados)
File “/data/…/smsUPS.py”, line 1200, in json_remove_vazio
cp_dados = json.loads(strJson) # cria uma copia
File “/usr/local/lib/python3.9/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.9/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/lib/python3.9/json/decoder.py”, line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid control character at: line 10 column 40 (char 279)
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts…
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

@dmsgyn
Bom dia.
Resolvi fazer uns testes basico.
Tirei o Cabo USB do Nobreak e o seu ADD ON subiu…
Reconectei o cabo e ele comecou a coletar as informacoes.

Se eu deixar o cabo conectado e reiniciar o seu ADD ON, ele gera o erro da primeira thread que criei acima.

I was unable to open the serial port /dev/ttyUSB0
2022-02-20 12:05:10,845 - root - WARNING - I was unable to open the serial port /dev/ttyUSB0
2022-02-20 12:05:12,953 - root - WARNING - send-cmd - serial not ok
No UPS Data
2022-02-20 12:05:12,954 - root - DEBUG - No UPS Data
[{“entity_id”: “persistent_notification.54543123”, “state”: “notifying”, “attributes”: {“title”: “smsUPS - No energy!”, “friendly_name”: “smsUPS - No energy!”, “message”: “ups_SMS_01
Running without energy for 0:00:03 seconds.

Battery level: 1 %
Shutdown battery level: 30 %
Estimated shutdown time in -1 day, 23:59:31

2022-02-20 12:05:12
by dmslabs”}, “last_changed”: “2022-02-20T14:58:23.586747+00:00”, “last_updated”: “2022-02-20T15:05:13.002610+00:00”, “context”: {“id”: “f0c259cea0f555586d5ee87309d407ca”, “parent_id”: null, “user_id”: “b40518f428b743448280cf993b7c94e7”}}]
batConsumo: 0.0
Dados UPS Publicados…2022-02-20 12:05:13.024439
I was unable to open the serial port /dev/ttyUSB0
2022-02-20 12:05:13,034 - root - WARNING - I was unable to open the serial port /dev/ttyUSB0
2022-02-20 12:05:13,849 - root - WARNING - send-cmd - serial not ok
No UPS Data
2022-02-20 12:05:13,850 - root - DEBUG - No UPS Data
[{“entity_id”: “persistent_notification.54543123”, “state”: “notifying”, “attributes”: {“title”: “smsUPS - No energy!”, “friendly_name”: “smsUPS - No energy!”, “message”: “ups_SMS_01
Running without energy for 0:00:09 seconds.

Battery level: 1 %
Shutdown battery level: 30 %
Estimated shutdown time in -1 day, 23:59:31

2022-02-20 12:05:13
by dmslabs”}, “last_changed”: “2022-02-20T14:58:23.586747+00:00”, “last_updated”: “2022-02-20T15:05:13.884032+00:00”, “context”: {“id”: “30b822849aa416d84740bd9bf2e62e12”, “parent_id”: null, “user_id”: “b40518f428b743448280cf993b7c94e7”}}]
batConsumo: 0.0
Porta: /dev/ttyUSB0 - True
2022-02-20 12:05:13,911 - root - INFO - Port /dev/ttyUSB0 - is open: True
2022-02-20 12:05:16,038 - root - WARNING - send-cmd - serial not ok
No UPS Data
2022-02-20 12:05:16,039 - root - DEBUG - No UPS Data
[{“entity_id”: “persistent_notification.54543123”, “state”: “notifying”, “attributes”: {“title”: “smsUPS - No energy!”, “friendly_name”: “smsUPS - No energy!”, “message”: “ups_SMS_01
Running without energy for 0:00:06 seconds.

Battery level: 1 %
Shutdown battery level: 30 %
Estimated shutdown time in -1 day, 23:59:31

2022-02-20 12:05:16
by dmslabs”}, “last_changed”: “2022-02-20T14:58:23.586747+00:00”, “last_updated”: “2022-02-20T15:05:16.073792+00:00”, “context”: {“id”: “fd7586ff3a01eabb4f4870ebd1f22280”, “parent_id”: null, “user_id”: “b40518f428b743448280cf993b7c94e7”}}]
batConsumo: 0.0
Porta: /dev/ttyUSB0 - True
2022-02-20 12:05:16,106 - root - INFO - Port /dev/ttyUSB0 - is open: True
No UPS Data
2022-02-20 12:05:18,621 - root - DEBUG - No UPS Data
[{“entity_id”: “persistent_notification.54543123”, “state”: “notifying”, “attributes”: {“title”: “smsUPS - No energy!”, “friendly_name”: “smsUPS - No energy!”, “message”: “ups_SMS_01
Running without energy for 0:00:13 seconds.

Battery level: 1 %
Shutdown battery level: 30 %
Estimated shutdown time in -1 day, 23:59:31

2022-02-20 12:05:18
by dmslabs”}, “last_changed”: “2022-02-20T14:58:23.586747+00:00”, “last_updated”: “2022-02-20T15:05:18.658162+00:00”, “context”: {“id”: “ea23866a9bf54e75bd15fe1eed6515e7”, “parent_id”: null, “user_id”: “b40518f428b743448280cf993b7c94e7”}}]
[{“entity_id”: “persistent_notification.54543124”, “state”: “notifying”, “attributes”: {“title”: “smsUPS - Energy returned!”, “friendly_name”: “smsUPS - Energy returned!”, “message”: “ups_SMS_01
Now battery is charging.

Battery level: 100 %
I ran without power for 0:00:10 seconds.

2022-02-20 12:05:20
by dmslabs”}, “last_changed”: “2022-02-20T15:05:20.852338+00:00”, “last_updated”: “2022-02-20T15:05:20.852338+00:00”, “context”: {“id”: “bfa2a72573f326b63408e35ccb48076d”, “parent_id”: null, “user_id”: “b40518f428b743448280cf993b7c94e7”}}]
[{“entity_id”: “persistent_notification.54543124”, “state”: “notifying”, “attributes”: {“title”: “smsUPS - Energy returned!”, “friendly_name”: “smsUPS - Energy returned!”, “message”: “ups_SMS_01
Now battery is charging.

Battery level: 100 %
I ran without power for 0:00:18 seconds.

2022-02-20 12:05:23
by dmslabs”}, “last_changed”: “2022-02-20T15:05:20.852338+00:00”, “last_updated”: “2022-02-20T15:05:23.435155+00:00”, “context”: {“id”: “8c2edeb0f38e09056c471976c279bedb”, “parent_id”: null, “user_id”: “b40518f428b743448280cf993b7c94e7”}}]

Vou tentar fazer uma modificação para ver se resolve este erro.

1 Like

Bom dia @dmsgyn .
Obrigado.
Seu add-on funciona muito bem!
Tive que adicionar uma linha no arquivo customize : unit_of_measurement: W para integrar no monitoramento de energy do HA.

sensor.sms_01_powernow:
state_class: measurement
unit_of_measurement: W


image
image

Vi que ele ta subindo o apache na porta 5000

Outra duvida.
Vi que ele possui um switch de “Beep Ligado” , não é possivel alterar o estado dele pelo HA, certo?
Pelos testes que fiz aqui, ele nao mudou.
image

Novamente, parabens pelo ADD-ON.

Fiz algumas modificações no add on, se puderem testar… v 0.40aa

Fala Daniel.
Tem hora que vai, tem hora que não.
Agora sem o cabo estar conectado, ele nao sobe.

2022-02-23 21:46:13,190 - root - DEBUG - Running inside HASSIO True
2022-02-23 21:46:13,191 - root - DEBUG - env1:/dev/ttyUSB0
Getting Config Parser.
2022-02-23 21:46:13,192 - root - DEBUG - Existe secrets.ini
Existe secrets.ini
Reading secrets.ini
2022-02-23 21:46:13,195 - root - WARNING - Reading secrets.ini
2022-02-23 21:46:13,198 - root - DEBUG - Config: SMSUPS_FULL_POWER use default: 1450
Getting Config Parser.
2022-02-23 21:46:13,199 - root - DEBUG - Existe secrets.ini
Existe secrets.ini
2022-02-23 21:46:13,203 - root - DEBUG - Config: ALLOW_SHUTDOWN use default: True
2022-02-23 21:46:13,204 - root - DEBUG - Config: DEVELOPERS_MODE use default: False
False
2022-02-23 21:46:13,205 - root - DEBUG - PORTA secrets: /dev/tty.usbserial-1440/dev/tty.usbserial-1470/dev/ttyUSB0/devx/ttyUSB0
NORMAL MODE
IN HASS.IO
2022-02-23 21:46:13,206 - root - DEBUG - Loading env data…
false
Getting Config Parser.
2022-02-23 21:46:13,207 - root - DEBUG - Existe secrets.ini
Existe secrets.ini
2022-02-23 21:46:13,211 - root - DEBUG - Env data loaded.
2022-02-23 21:46:13,211 - root - DEBUG - PORTA substitui: /dev/ttyUSB0
2022-02-23 21:46:13,212 - root - DEBUG - SMSUPS_SERVER: True
2022-02-23 21:46:13,213 - root - DEBUG - SMSUPS_CLIENTE: False
2022-02-23 21:46:13,213 - root - DEBUG - MQTT_HOST: core-mosquitto
2022-02-23 21:46:13,214 - root - DEBUG - IP: 192.168.15.45
SMSUPS_SERVER: True
SMSUPS_CLIENTE: False
IP: 192.168.15.45
UPS_ID: 01
UPS_NAME: SMS
UPS_NAME_ID: ups_SMS_01
ALLOW_SHUTDOWN: False
Getting OS Data
2022-02-23 21:46:13,215 - root - INFO - os.name: posix
Can’t get OS Data
info / Error! Code: OSError, Message, unable to determine login name
2022-02-23 21:46:13,216 - root - DEBUG - info / Error! Code: OSError, Message, unable to determine login name
info / Error! Code: OSError, Message, unable to determine login name
2022-02-23 21:46:13,217 - root - DEBUG - info / Error! Code: OSError, Message, unable to determine login name
info / Error! Code: OSError, Message, unable to determine login name
2022-02-23 21:46:13,218 - root - DEBUG - info / Error! Code: OSError, Message, unable to determine login name
sh: /ls: not found
/dev/ttyUSB0n/dev/ttyUSB0o/dev/ttyUSB0t/dev/ttyUSB0 /dev/ttyUSB0e/dev/ttyUSB0x/dev/ttyUSB0i/dev/ttyUSB0s/dev/ttyUSB0t
2022-02-23 21:46:13,230 - root - INFO - Starting MQTT core-mosquitto
2022-02-23 21:46:13,230 - root - DEBUG - mqttStart MQTT_PASSWORD: Iv1vae3shoh3oyoheiJaephaoh9nishaR2apoo9Aesu1ahngohdoo3siijo6Toh3
MQTT connected with result code 0
2022-02-23 21:46:13,238 - root - DEBUG - MQTT connected with result code 0
Connected to core-mosquitto
2022-02-23 21:46:13,238 - root - INFO - Subscribe Topic: home/ups/cmd
Subscribe Topic: home/ups/cmd
Porta: /dev/ttyUSB0 - True
2022-02-23 21:46:14,245 - root - INFO - Port /dev/ttyUSB0 - is open: True
portstr: /dev/ttyUSB0
2022-02-23 21:46:16,048 - root - DEBUG - cmd:Name / str: 49 ff ff ff ff bb 0d / Q: False
2022-02-23 21:46:26,756 - root - DEBUG - response: b’3a4e45542057494e4e45522020332e301b0d’
2022-02-23 21:46:26,757 - root - DEBUG - cmd:Info / str: 46 ff ff ff ff be 0d / Q: False
2022-02-23 21:46:37,474 - root - DEBUG - response: b’3b3131352f3232303030303031323630e20d’
2022-02-23 21:46:37,475 - root - DEBUG - UPS Info: NET WINNER 3.0e
/
2022-02-23 21:46:37,476 - root - DEBUG - UPS Info: NET WINNER 3.0e /
2022-02-23 21:46:37,478 - root - DEBUG - Sensor_dic: 0
2022-02-23 21:46:37,490 - root - WARNING - erro json.load:
{
“stat_t”: “home/ups_SMS_01/json”,
“name”: “SMS_01_inputVac”,
“uniq_id”: “SMS_01_inputVac”,
“val_tpl”: “{{ value_json.inputVac }}”,
“icon”: “mdi:transmission-tower-export”,
“device_class”: “voltage”,
“expire_after”: “360”,
“device”: { “name”: “NET WINNER 3.0e”,
“manufacturer”: “dmslabs”,
“model”: “”,
“sw_version”: “0.40aa1”,
“via_device”: “smsUPS”,
“identifiers”: [ “SMS_01” ] }
}
Traceback (most recent call last):
File “/data/…/smsUPS.py”, line 1629, in
send_hass()
File “/data/…/smsUPS.py”, line 1277, in send_hass
monta_publica_topico(k[0], sensor_dic[k[0]], varComuns)
File “/data/…/smsUPS.py”, line 1243, in monta_publica_topico
dados = json_remove_vazio(dados)
File “/data/…/smsUPS.py”, line 1214, in json_remove_vazio
cp_dados = json.loads(strJson) # cria uma copia
File “/usr/local/lib/python3.9/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.9/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/lib/python3.9/json/decoder.py”, line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid control character at: line 10 column 40 (char 279)
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts…
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Fiz o rollback da versao anterior e fazendo do jeito que funcionava (tirar o cabo , subir o add-on e colocar o cabo) funciona mais facil, do que tentar parar e restartar o add-on até subir.

Nesta versao nova, quando inicia com sucesso, ele está demorando muito para coletar os dados…Coisa de 10 a 20 segundos.
Na versao 0.39j ele coleta os dados instantaneamente , mas em contra partida, o consumo de cpu na versao 0.39j é bem mais elevada.

Oi !
Eu acho que a versão 0.42 resolve este problema.

Você poderia testar?

Sim!
Vou testar e te informo.
Obrigado

@dmsgyn , continua o erro :frowning: …agora nao sobe mais

MQTT_HOST - core-mosquitto
MQTT_PASS - Iv1vae3shoh3oyoheiJaephaoh9nishaR2apoo9Aesu1ahngohdoo3siijo6Toh3
Serial ports
total 0
drwxr-xr-x 2 root root 60 Feb 23 22:08 .
drwxr-xr-x 4 root root 80 Feb 23 22:08 …
lrwxrwxrwx 1 root root 13 Feb 23 22:08 usb-Cypress_Semiconductor_USB_to_Serial-if00-port0 → …/…/ttyUSB0
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 0424:2514
Bus 001 Device 002: ID 0424:2514
Bus 001 Device 005: ID 0424:7800
Bus 001 Device 007: ID 04b4:5500
[18:41:26] INFO: secrets.ini exists!
[18:41:26] INFO: /data/secrets.ini exists!
SMS BRASIL UPS - dmslabs
********** dmslabs smsUPS v.0.41
Starting up… 2022-02-24 18:41:28
2022-02-24 18:41:28,602 - root - DEBUG - ********** dmslabs smsUPS v.0.41
2022-02-24 18:41:28,603 - root - DEBUG - Starting up…
Path: /data
2022-02-24 18:41:28,603 - root - DEBUG - Path: /data
hassio_token:f31122dc91b156b0a9858429ffab6c3847e7b39d38ed9fae28bab6c44ef32d982498a60788579e213fa6d62d75dc9c76f132b76182b17045
2022-02-24 18:41:28,604 - root - DEBUG - Running inside HASSIO True
2022-02-24 18:41:28,604 - root - DEBUG - env1:/dev/ttyUSB0
Getting Config Parser.
2022-02-24 18:41:28,605 - root - DEBUG - Existe secrets.ini
Existe secrets.ini
Reading secrets.ini
2022-02-24 18:41:28,609 - root - WARNING - Reading secrets.ini
2022-02-24 18:41:28,612 - root - DEBUG - Config: SMSUPS_FULL_POWER use default: 1450
Getting Config Parser.
2022-02-24 18:41:28,612 - root - DEBUG - Existe secrets.ini
Existe secrets.ini
2022-02-24 18:41:28,617 - root - DEBUG - Config: ALLOW_SHUTDOWN use default: True
2022-02-24 18:41:28,617 - root - DEBUG - Config: DEVELOPERS_MODE use default: False
False
2022-02-24 18:41:28,619 - root - DEBUG - PORTA secrets: /dev/tty.usbserial-1440/dev/tty.usbserial-1470/dev/ttyUSB0/devx/ttyUSB0
NORMAL MODE
IN HASS.IO
2022-02-24 18:41:28,619 - root - DEBUG - Loading env data…
false
Getting Config Parser.
2022-02-24 18:41:28,620 - root - DEBUG - Existe secrets.ini
Existe secrets.ini
2022-02-24 18:41:28,625 - root - DEBUG - Env data loaded.
2022-02-24 18:41:28,625 - root - DEBUG - PORTA substitui: /dev/ttyUSB0
2022-02-24 18:41:28,626 - root - DEBUG - SMSUPS_SERVER: True
2022-02-24 18:41:28,626 - root - DEBUG - SMSUPS_CLIENTE: False
2022-02-24 18:41:28,627 - root - DEBUG - MQTT_HOST: core-mosquitto
2022-02-24 18:41:28,628 - root - DEBUG - IP: 192.168.15.45
SMSUPS_SERVER: True
SMSUPS_CLIENTE: False
IP: 192.168.15.45
UPS_ID: 01
UPS_NAME: SMS
UPS_NAME_ID: ups_SMS_01
ALLOW_SHUTDOWN: True
Getting OS Data
2022-02-24 18:41:28,629 - root - INFO - os.name: posix
Can’t get OS Data
info / Error! Code: OSError, Message, unable to determine login name
2022-02-24 18:41:28,629 - root - DEBUG - info / Error! Code: OSError, Message, unable to determine login name
info / Error! Code: OSError, Message, unable to determine login name
2022-02-24 18:41:28,630 - root - DEBUG - info / Error! Code: OSError, Message, unable to determine login name
info / Error! Code: OSError, Message, unable to determine login name
2022-02-24 18:41:28,631 - root - DEBUG - info / Error! Code: OSError, Message, unable to determine login name
sh: /ls: not found
/dev/ttyUSB0n/dev/ttyUSB0o/dev/ttyUSB0t/dev/ttyUSB0 /dev/ttyUSB0e/dev/ttyUSB0x/dev/ttyUSB0i/dev/ttyUSB0s/dev/ttyUSB0t
2022-02-24 18:41:28,636 - root - INFO - Starting MQTT core-mosquitto
2022-02-24 18:41:28,637 - root - DEBUG - mqttStart MQTT_PASSWORD: Iv1vae3shoh3oyoheiJaephaoh9nishaR2apoo9Aesu1ahngohdoo3siijo6Toh3
MQTT connected with result code 0
2022-02-24 18:41:28,645 - root - DEBUG - MQTT connected with result code 0
Connected to core-mosquitto
2022-02-24 18:41:28,646 - root - INFO - Subscribe Topic: home/ups/cmd
Subscribe Topic: home/ups/cmd
Porta: /dev/ttyUSB0 - True
2022-02-24 18:41:29,651 - root - INFO - Port /dev/ttyUSB0 - is open: True
portstr: /dev/ttyUSB0
2022-02-24 18:41:31,454 - root - DEBUG - cmd:Name / str: 49 ff ff ff ff bb 0d / Q: False
2022-02-24 18:41:42,171 - root - DEBUG - response: b’3a4e45542057494e4e45522020332e301b0d’
2022-02-24 18:41:42,172 - root - DEBUG - cmd:Info / str: 46 ff ff ff ff be 0d / Q: False
2022-02-24 18:41:52,886 - root - DEBUG - response: b’3b3131352f3232303030303031323630e20d’
2022-02-24 18:41:52,887 - root - DEBUG - UPS Info: NET WINNER 3.0e
/
2022-02-24 18:41:52,888 - root - DEBUG - UPS Info: NET WINNER 3.0e /
2022-02-24 18:41:52,889 - root - DEBUG - Sensor_dic: 0
2022-02-24 18:41:52,894 - root - WARNING - erro json.load:
{
“stat_t”: “home/ups_SMS_01/json”,
“name”: “SMS_01_inputVac”,
“uniq_id”: “SMS_01_inputVac”,
“val_tpl”: “{{ value_json.inputVac }}”,
“icon”: “mdi:transmission-tower-export”,
“device_class”: “voltage”,
“expire_after”: “360”,
“device”: { “name”: “NET WINNER 3.0e”,
“manufacturer”: “dmslabs”,
“model”: “”,
“sw_version”: “0.41”,
“via_device”: “smsUPS”,
“identifiers”: [ “SMS_01” ] }
}
Traceback (most recent call last):
File “/data/…/smsUPS.py”, line 1629, in
send_hass()
File “/data/…/smsUPS.py”, line 1277, in send_hass
monta_publica_topico(k[0], sensor_dic[k[0]], varComuns)
File “/data/…/smsUPS.py”, line 1243, in monta_publica_topico
dados = json_remove_vazio(dados)
File “/data/…/smsUPS.py”, line 1214, in json_remove_vazio
cp_dados = json.loads(strJson) # cria uma copia
File “/usr/local/lib/python3.9/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.9/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/lib/python3.9/json/decoder.py”, line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid control character at: line 10 column 40 (char 279)
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts…
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Olá.

Muito obrigado, pela correção e atenção que vc tem dado a esse projeto.

Agora ele iniciou e já estou conseguindo ter acesso as leituras das informações do nobreak.

image

Será que é algo especifico do meu modelo? SMS Net Winner
Na versao 0.39j ele ta funcionando, se fizer daquele jeito, iniciar o add-on com o cabo usb desconectado e dps que inicializa, reconectar o cabo…ai funciona sem problemas

Pode ser que seja. Já que é um modelo fora de linha da SMS.

Ele ainda é comercializado