thanks again Edi.
I will first make a full backup and put it on a new ssd.
after that i will test your solutions as far as i can.
sorry, i must have overlooked the code snippets function.
best regards
thanks again Edi.
I will first make a full backup and put it on a new ssd.
after that i will test your solutions as far as i can.
sorry, i must have overlooked the code snippets function.
best regards
Hi,
Thanks a lot, it works.
If I remove mysensors from the yaml I can actually call a reboot again without problems.
i had only the serial usb-gateway in the configuration.yaml
MySensors now works without the entry in the yaml. After a reboot all entities are listed and work. but how can i change the parameters, e.g. the serial port of the gateway?
here the section which concerns mysensors.
mysensors:
gateways:
logger:
default: info
logs:
homeassistant.components.mysensors: debug
mysensors: debug
...or did you mean the full protocol?
i have downloaded it. i hope it will be of help.
...
sorry, i can't send upload as file or as graphic. the board always gives error.
it always expects a graphic file.
Hi, thank you for your feedback.
here are the 2 protocols that concern mysensors:
First:
Logger: homeassistant.components.websocket_api.http.connection
Source: helpers/check_config.py:184
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:20:17 (1 occurrences)
Last logged: 11:20:17
[547863234576] 'mysensors'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1910, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1950, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 887, in admin_handler
await result
File "/usr/src/homeassistant/homeassistant/components/homeassistant/init.py", line 311, in async_handle_reload_all
if errors := await conf_util.async_check_ha_config_file(hass):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/config.py", line 982, in async_check_ha_config_file
res = await check_config.async_check_ha_config_file(hass)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/check_config.py", line 184, in async_check_ha_config_file
result[domain] = config[domain]
~~~~~~^^^^^^^^
KeyError: 'mysensors'
and the second:
Logger: homeassistant.components.mysensors
Source: helpers/config_validation.py:867
Integration: MySensors (documentation, issues)
First occurred: 11. Juni 2023 um 18:35:52 (2 occurrences)
Last logged: 11:20:17
The 'mysensors' option near /config/configuration.yaml:2 has been removed, please remove it from your configuration
The 'mysensors' option has been removed, please remove it from your configuration
unfortunately my knowledge is not sufficient to understand that
thanx
branther
Hi,
i need help again.
when i want to restart or quickly reboot my homeassistant i get the error.
configuration could not be started
"error calling the service homeassistant/reload_all. 'mysensors'"
so i can only do a complete restart.
has something changed in homeassistant in version Core 6.1 regarding MySensors?
best regards
thank you for the link.
thank you,
i use Homeassistant
I have additionally discovered that the WLAN from my LG TV also causes interference.
Then I disabled the wifi on the LG. I do not need it because I have an additional TV receiver.
Now this has also become better.
The change from USB-2 to USB-3, the new 100mF electrolytic capacitor and the 3.3v power supply via an AMS1117 3.3v brought the solution.
Finally no more error led.
thanks best regards
by the way, /opt/apps/mycontroller i don't have this directory.
hi, yes, thank you again
i also use DeepL for my posts. my english is not very good.
yes i use an arduino serial usb gateway
"https://github.com/mysensors/MySensors/blob/master/examples/GatewaySerial/GatewaySerial.ino"
the my_debug protocol is enabled.
#define MY_SPECIAL_DEBUG i didn't know, that's new to me. I will test it.
/opt/apps/mycontroller i will have a look, thanks.
however my problem was not solved after all.
after i reconnected the GW to my raspi, the error-led was activated again every 20minutes.
despite the new electrolytic capacitor (100mF)
after that i suspected that the 3,3v power supply of the arduino nano is not enough to supply the nrf with enough current when sending.
i looked in the shematics and found that the 3.3v comes from the USB-Uart (CH340) of the nano and delivers only little current.
So i installed an AMS1117 3,3V direct on USB-5v which can supply at least 800mA.
i will keep watching but i guess that will not solve the problem.
i think it's a power problem because the raspi can't supply enough power to the usb port either.
ohh, that reminds me, why don't i use the usb-3 port?
i will test it.
next i will connect an external power supply and keep watching.
the problem with the PIR sensors is their duration. You have to move so that they are always reset and restarted or set a fixed time.
The LD2401 are adjustable for range and sensitivity. They respond better to human presence.
I have had good experience with the LD2401-C module.
Firstly, it has 2.54mm mullion connectors and secondly, you can set it up via app using Bluetooth.
The mmVawe-modules are a bit more power consuming than the Pir-module.
Besides plus/minus 5V you only need one pin which gives a high signal when detected.
My light I no longer need switches on the wall
(I have left it in the standard setup and have not yet made any experience with Bluetooth setup).
by the way, the C versions with Bluetooth are immediately recognized in Homeassistant and listed as a device.
... if you have a BL Gateway.
thanks for the links
it didn't occur to me that you can also connect the serial usb-gateway to the pc to debug it.
i thought that has to be done in the linux terminal on the raspi.
ok.
what turns out is that exactly every 20 minutes a
"Send transport network discovery request"
(could have been noticed before, if you know how the gateway works)
is sent but in RED this message :
"Sent Message without radio ACK"
is displayed in the parser.
Well, I suspected that the 10mF capacitor is not enough and replaced it with a 100mF capacitor.
Since then the above message is displayed but the ERROR-LED is not activated anymore.
Here is the output at the parser:
Seemingly OK!!?*
The gateway is powered by the Raspi via USB.
It is an Atmel328P 16MHz. 5V Arduino. The voltage for the nrf24 is fed from the 3,3V output of the Arduino.
i think my problem is solved with this. no error led is activated anymore. It was probably due to the too small Elco. exchanged from 10mF to 100mF.
I will continue to monitor it (whether I want or not )
...solved...
best regards.
ohh, did i choose the wrong area for my request?
i ask the admins to move it to the troubleshooter section if possible.
thank you
I have stopped the time between the erros several times.
the error led is triggered exactly every 20 minutes.
I have had all my analog sensors in view. all send in their set time without error.
this gateway error seems to have nothing to do with my transmitters (car voltmeter, home powermeter, 3 thermometers).
exactly every 20 minutes, what can that be?
Can it be triggered by zigbee or wifi?
I have here a Sonof Zigbee dongle and a Fritzbox Lan/Wlan router
If I can not find the cause I will probably disconnect the LED, which is getting on my nerves
best regards
hello all,
I have changed my gateway from wireles (Wemos-D1 Mini) to serial.
among other things, i have also activated the led for errors and connected it to pin-4.
now this errror-led flashes every few minutes, 3-4 times in a row in short intervals.
because the Wemos mini was connected to my PC, i could log via the usb-port to maybe detect the error with the parser.
But since the serial gateway is directly connected to my raspberry, i don't know how to log the communication.
is there a way to detect what causes this error in the serial gateway?
(please understand, i am still a newbie)
best regards
super, once again a few super links, thanks for that
i will go for the easy way. this sketch by boots33 works perfectly.
But before that i will try to understand and learn the steps.
thanks again
branther
hmm, but there is still a small problem
if the GW, Homeassistant or the nRF of the relay are off and you restart or reset the relay then it goes into the state of "isTransportReady() = false" and thus works in offline mode (as desired).
As soon as the GW is active again the relay will be active online again.
so far so good!
but the other way around, if the relay is running in online state, so it is connected to the GW and the GW or Homeassistant go offline, it is not recognized by the relay. I have to do a reboot or reset first to get it working again in offline mode.
My question now:
Is there any function I can run in the loop() so that after 2sec. or so after manually switching it is detected that the GW is not giving any response and then here "isTransportReady()" is switched from true to false?
i think with this a switch from online to offline would work automatically. or?
thanks in advance
branther
wow, great, that was exactly what I was looking for.
Thanks for the link, I would not have found it in the forum, despite intensive search.
The functions "MY_TRANSPORT_WAIT_READY_MS" and "if (isTransportReady())" in the loop() brought exactly the result I was looking for.
I admit, I had some problems with the implementation but now everything works perfectly and I am the boss of my relays again.
Now I will flash all relays one by one. Unfortunately I have my rest-proMini 168 arduinos installed. Thus no option for OTA.
best thanks @JeeLet
greetings
branther
thank you very much for the quick answer and the link.
I will try it right away.
I have about 7 relays with pushbuttons that control my lights in the apartment.
everything is ok as long as the gateway and or the raspberry is running with homeassistant.
I have been in the dark a few times when it came to MySensors relays. (ZigBee also works without gateway)
I have not found a solution yet. You could get the Arduino to switch the relay (on/off) simply by pressing a button, but as soon as a #include MySensors is entered in the scetch before setup, the module searches for a gateway before it can continue with the rest of the routines.
does anyone have a solution for my problem? unfortunately I can't get any further.
best regards
branther
yes, absolutely. i always order all my components from aliexpress.
i don't think it makes any difference which dealer i use there.
you can be lucky and sometimes not
sometimes you can tell right away, for example an NRF module didn't have an IRQ. sometimes you have to search specifically to get the nrf24l plus model for example, which is different from the normal nrf module.
in germany the parts are 3-4 times more expensive.
so i put up with it. if you have several components, you can swap them and limit the error.
thanks again
Sorry, also here you can close the post
it turned out that some components were defective.
it took me a long time to discover it and I disposed of the components.
serial gateway works flawlessly with my voltmeter un my motor vehicle.
greetings
branther
so, hello again.
i must apologize. the errors were mine.
I had several defective nrf24l
i also had a couple of faulty ESP8266s to top it off
In addition, the power supply regulated to 3.3v for the transmitter Arduino was not sufficient. etc. etc..
I have experimented a lot.
Now finally everything runs as expected
(I hope for a long time)
this post can be closed.
best regards.
sorry for my late reply. i don't have time to continue at the moment.
I will try to implement your suggested solution.
the problem still exists and i will report back.
thanks for your feedback
best regards
branther
sorry for my late reply. i don't have time to continue at the moment.
but i will continue to report when i have more time. at the moment it is very complicated.
the problem still exists and i will report back.
thanks for your feedback
@JeeLet thank you for your feedback.
I have already replaced all components, so I assume that there is no hardware defect.
i think i have found the error. at least that's how it looks.
i have changed the gateway. before it was a TCP gateway with a Wemos D1.
I want to get away from WiFi, so now I use a serial gateway.
as described all sensors and actuators work with this gateway. only not S_Multimeter with V_Voltage.
To get around my programming errors here as well, I used a standard sketch from github.
https://github.com/barduinor/MySensors-Barduino/tree/development/examples/MockMySensors
here i simply enabled #define ID_S_Multimeter to it and uploaded it.
with the serial gateway only S_ARMED and S_DOOR are recognized.
with the TCP gateway S_Multimeter is also recognized.
maybe someone with Serial Gateway can also try this and confirm my assumption or not.
There must be no other circuit connected. one arduino, one nrf24 and one sketch
best regards
when changing from a tcp gateway (wemos D1) to a serial gateway, i noticed that there must be some differences between the two gateways.
the serial interface does not connect S_Mutimeter and V_Voltage
the TCP gateway can do that without problems
i tried it with my own sketch as well as with MockMySensors.ino.
in mockMysSensors i activate 3 entities. one of them is S_Multimeter.
with the serial gateway only 2 entities are recognized
with the TCP Gateway all 3 entities are recognized.
i use homeassistant version 2023.3.4
MySensors version 2.3.2
who can help here?
best regards
branther
Translated with www.DeepL.com/Translator (free version)
it's a pity that no one here seems to be able to help.
I have been looking for solutions for several days.
I have restarted homeassistant and mysensors.
what i have found out so far is:
the serial gateway does not work
the wemos d1 gateway works.
whereas both gateways all others (13 pieces with 20 entities) are recognized immediately without any problems.
only my voltmeter in the car does not work with the serial gatreway
very strange
Translated with www.DeepL.com/Translator (free version)
hello all,
i am a newbie when it comes to mysensors. nevertheless, by copy and paste i have built a sensor that sends the battery voltage from my car to my homeassistant every 20 min. My car is parked by the road and is not used much. so i want to keep an eye on the voltage.
so far this has worked for about 6 months.
for some inexplicable reason, it no longer does.
so i can rule out a hardware error i turned it off and set up a test sensor on a plug-in module.
the debug values seem ok to me , but i can't judge it seriously. but it is not detected by my serial gateway.
can someone help me and tell what can be wrong?
i will share here the debuginfo and the sketch.
i hope for your help, thanks.
16 MCO:BGN:INIT NODE,CP=RNNNA---,FQ=16,REL=255,VER=2.3.2
26 TSM:INIT
28 TSF:WUR:MS=0
34 TSM:INIT:TSP OK
36 TSM:INIT:STATID=122
38 TSF:SID:OK,ID=122
40 TSM:FPAR
45 ?TSF:MSG:SEND,122-122-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
440 TSF:MSG:READ,0-0-122,s=255,c=3,t=8,pt=1,l=1,sg=0:0
445 TSF:MSG:FPAR OK,ID=0,D=1
459 TSF:MSG:READ,122-0-122,s=255,c=3,t=8,pt=1,l=1,sg=0:1
626 TSF:MSG:READ,6-6-122,s=255,c=3,t=8,pt=1,l=1,sg=0:1
777 TSF:MSG:READ,4-4-122,s=255,c=3,t=8,pt=1,l=1,sg=0:1
2052 TSM:FPAR:OK
2053 TSM:ID
2054 TSM:ID:OK
2056 TSM:UPL
2059 TSF:MSG:SEND,122-122-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
2070 TSF:MSG:READ,0-0-122,s=255,c=3,t=25,pt=1,l=1,sg=0:1
2075 TSF:MSG:PONG RECV,HP=1
2078 TSM:UPL:OK
2079 TSM:READY:ID=122,PAR=0,DIS=1
2084 TSF:MSG:SEND,122-122-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
2093 TSF:MSG:READ,0-0-122,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
2100 TSF:MSG:SEND,122-122-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.2
2109 TSF:MSG:SEND,122-122-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
2138 TSF:MSG:READ,0-0-122,s=255,c=3,t=6,pt=0,l=1,sg=0:M
2146 TSF:MSG:SEND,122-122-0-0,s=255,c=3,t=11,pt=0,l=9,sg=0,ft=0,st=OK:Voltmeter
2155 TSF:MSG:SEND,122-122-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
2163 TSF:MSG:SEND,122-122-0-0,s=1,c=0,t=30,pt=0,l=12,sg=0,ft=0,st=OK:KFZ-Batterie
2423 TSF:MSG:SEND,122-122-0-0,s=2,c=0,t=30,pt=0,l=16,sg=0,ft=0,st=OK:Versorgungs-Akku
2931 !MCO:SND:NODE NOT REG
3184 !MCO:SND:NODE NOT REG
3688 TSF:MSG:SEND,122-122-0-0,s=1,c=2,t=38,pt=0,l=0,sg=0,ft=0,st=OK:
3696 TSF:MSG:SEND,122-122-0-0,s=2,c=2,t=38,pt=0,l=0,sg=0,ft=0,st=OK:
Presentation done
3702 MCO:REG:REQ
3707 TSF:MSG:SEND,122-122-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
3715 TSF:MSG:READ,0-0-122,s=255,c=3,t=27,pt=1,l=1,sg=0:1
3720 MCO:PIM:NODE REG=1
3723 MCO:BGN:STP
3724 MCO:BGN:INIT OK,TSP=1
3729 TSF:MSG:SEND,122-122-0-0,s=1,c=1,t=38,pt=7,l=5,sg=0,ft=0,st=OK:11.5
3774 !TSF:MSG:SEND,122-122-0-0,s=2,c=1,t=38,pt=7,l=5,sg=0,ft=0,st=NACK:5.0
KFZ-Batterie: 11.5
Versorgungs-Akku: 5.0
3781 MCO:SLP:MS=5000,SMS=0,I1=255,M1=255,I2=255,M2=255
3789 TSF:TDI:TSL
3790 MCO:SLP:WUP=-1
3792 TSF:TRI:TSB
3802 !TSF:MSG:SEND,122-122-0-0,s=1,c=1,t=38,pt=7,l=5,sg=0,ft=1,st=NACK:15.6
3811 !TSF:MSG:SEND,122-122-0-0,s=2,c=1,t=38,pt=7,l=5,sg=0,ft=2,st=NACK:5.7
KFZ-Batterie: 15.6
Versorgungs-Akku: 5.7
3819 MCO:SLP:MS=5000,SMS=0,I1=255,M1=255,I2=255,M2=255
3827 TSF:TDI:TSL
and here the sketch
#include <Arduino.h>
// Enable debug prints
#define MY_DEBUG
#define MY_RADIO_RF24
#define MY_NODE_ID 122 // Immer eindeutig pro Sensor
#define CHILD_ID_KFZ_Akku 1
#define CHILD_ID_Versorgungs_Akku 2
//#define CHILD_ID_BetriebsSpannung 3
const float INTERN = 1.1; // bestimmt pro IC
float vcc = 5.0; // wird dann gemessen
int sleepTime = 5000; // 4sec.
int sleepTimePin = 6; // Testpin. gegen Masse = 10min. Offen=4sec.
int KFZ_Batterie_SENSE_PIN = A2; // KFZ-Akku-Spannung
int Versorgungs_Batterie_SENSE_PIN = A1; // Betriebs-Akku-Spannung / weil A0 defekt war wurde es getausch
float KFZFaktor = 0.01523; // // mit Spannungsteiler von 16V auf 1.1V gerechnet (470Ohm Parallel und 6,8k in Reihe)
float VersorgungsFaktor=0.00560; // รผber Spannungsteiler muss 1,1v ergeben von max 5v (220k und 50K)
int OldKFZBatteriePcnt = 0;
int OldVersorgungsBatteriePcnt = 0;
#include <MySensors.h>
MyMessage msgKFZ_Voltage(CHILD_ID_KFZ_Akku, V_VOLTAGE);
MyMessage msgVersorgungs_Akku(CHILD_ID_Versorgungs_Akku, V_VOLTAGE);
//*******************************
void presentation()
//*******************************
{
sendSketchInfo("Voltmeter", "1.0");
present(CHILD_ID_KFZ_Akku, S_MULTIMETER, "KFZ-Batterie");
delay(250);
present(CHILD_ID_Versorgungs_Akku, S_MULTIMETER, "Versorgungs-Akku");
delay(250);
delay(250);
send(msgKFZ_Voltage.set(6, 1));
delay(250);
send(msgVersorgungs_Akku.set(6, 1));
delay(250);
delay(250);
request(CHILD_ID_KFZ_Akku, V_VOLTAGE);
request(CHILD_ID_Versorgungs_Akku, V_VOLTAGE);
Serial.println(F("Presentation done"));
}
//*******************************
void setup()
//*******************************
{
// use the 1.1 V internal reference
analogReference(INTERNAL);
pinMode(sleepTimePin, INPUT_PULLUP); // Pin fรผr Schlafzeit
if (digitalRead(sleepTimePin) == LOW) sleepTime=600000;
else sleepTime=5000;
}
//*******************************
void loop()
//*******************************
{
//Serial.println("Aufwachen und senden");
//delay(100);
float KFZ_voltage = analogRead(KFZ_Batterie_SENSE_PIN);
float Versorgungs_voltage = analogRead(Versorgungs_Batterie_SENSE_PIN);
KFZ_voltage = KFZ_voltage * KFZFaktor;
Versorgungs_voltage = Versorgungs_voltage * VersorgungsFaktor;
float KFZBatteriePcnt = KFZ_voltage; // /25; // Sendet nur bei รnderung der Spannung um 0.5V...jetzt immer bei รคnderung
float VersorgungsBatteriePcnt = Versorgungs_voltage; // /25;
if ((OldKFZBatteriePcnt != KFZBatteriePcnt) || (OldVersorgungsBatteriePcnt != VersorgungsBatteriePcnt )) {
send(msgKFZ_Voltage.set(KFZ_voltage, 1));
send(msgVersorgungs_Akku.set(Versorgungs_voltage, 1));
Serial.print(F("KFZ-Batterie: ")); Serial.println(KFZ_voltage, 1);
Serial.print(F("Versorgungs-Akku: ")); Serial.println(Versorgungs_voltage, 1);
Serial.println();
OldKFZBatteriePcnt = KFZBatteriePcnt;
OldVersorgungsBatteriePcnt = VersorgungsBatteriePcnt;
}
sleep(sleepTime);
}
i must add that i already have 13 other sensors and actuators running.
These are running perfectly.