logo elektroda
logo elektroda
X
logo elektroda

Tuya LSPA9 smart socket - teardown, OpenBeken flashing guide for CB2S, BL0942

p.kaczmarek2 90534 372
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #361 21496524
    rufus4
    Level 10  
    >>21496438 this is normal in that usecase. otherwise the device would be needed to be designed for wall push buttons.
    S1 - S2 shorted manually is allways a glosed contact. it is not a impulse, it is a state.
    software and hardware buttons give a impulse
    .  wrong thought

    Added after 4 [minutes]:

    >>21496495 thanks, yes I think as well it is better to have both hardware versions as samples.
  • ADVERTISEMENT
  • #362 21496812
    p.kaczmarek2
    Moderator Smart Home
    badboy3004 wrote:

    the dInput_n is working. But there is a small problem. If I switch ON the light with the switch and turn it OFF with the HA then I need to switch OFF the switch and switch ON again so the light came ON.
    Like I sayed a small problem.

    This can be fixed via script.
    Let's assume you have dInput on channel 2 and Relay on channel 1.
    If you do:
    
    addEventHandler OnChannelChange 2 ToggleChannel 1
    

    then a state change on dInput will toggle Relay, but at the same time, you will be able to toggle relay from HA as well. Can you try?
    Helpful post? Buy me a coffee.
  • #363 21496865
    rufus4
    Level 10  
    >>21496812 I can confirm that this script is working allright. excellent!

    actually pin24 should be set to TglChanOnTgl but this causes the descripted errors with triggering the relais uncontrolled. strange that it worked without problems now when I tested again. befor it was switching like crazy.

    Added after 20 [minutes]:

    update:

    after playing arround I found out that the two hardware versions work different. thats why it was a bit confusing mixing them up.

    PSW-22V3a simply works with pin24 set TglChanOnTgl

    PSW1-24v3-WF only works with pin24 set dInput_n plus autoexec.bat addEventHandler OnChannelChange 2 ToggleChannel 1

    @divadiow sorry
  • ADVERTISEMENT
  • #364 21498510
    badboy3004
    Level 6  
    Hello rufus4,

    how can I create the autoexec.bat for all the drivers? Do you have the cleanest way for the setup of this switches?

    Thanks.
  • #365 21498563
    divadiow
    Level 34  
    >>21496865

    ok. adding these:

    Code: JSON
    Log in, to see the code


    Added after 4 [minutes]:

    badboy3004 wrote:
    how can I create the autoexec.bat for all the drivers? Do you have the cleanest way for the setup of this switches?

    https://www.youtube.com/watch?v=kXi8S12tmC8
  • ADVERTISEMENT
  • #366 21498573
    rufus4
    Level 10  
    >>21498510 Drivers you can start as a startup_command under cfg or in the autoexec.bat.
    Don't know if there is a best way.
    But with your device you need to have autoexec.bat for the script addeventhandler... anyway.

    my startcommand is for example:
    backlog startDriver NTP; ntp_setServer 192.168.1.1; ntp_timeZoneOfs +0; PowerSave 1 ;startDriver BL0942


    not shure how it would be correct in autoexec.bat, but it works in my case like this:
    startDriver NTP
    ntp_setServer 192.168.1.1
    ntp_timeZoneOfs +0
    
    PowerSave 1
    
    startDriver BL0942
    
    addEventHandler OnChannelChange 2 ToggleChannel 1


    more informations you can find here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md

    Added after 10 [minutes]:

    Hi @divadiow
    the only thing what I can see on "PSW1-24v3-WF" is:
    divadiow wrote:
    "24": "dInput_n;1"

    would be needed to be set as: "24": "dInput_n;2"


    Added after 4 [minutes]:

    divadiow wrote:
    "model": "PSW-22V3a",
        "chip": "BK7231N",
        "board": "CB2S",
        "flags": "1024",
        "keywords": [
          "DIY",
          "relay",
          "Y3F-105DM",
          "BL0942"

    and relay is a other, more flat typ: Y12FT-105DM

    all the rest is fine I guess
  • #367 21498643
    badboy3004
    Level 6  
    Hello divadiow, rufus4

    do I understand it right?
    I copy paste it here:

    User interface for generating and applying OBK configuration scripts.

    What should i write inside the autoexec.bat file here:


    User interface for editing the /autoexec.bat file with save and run options.

    Thank you both very much for support.
  • #368 21498971
    rufus4
    Level 10  
    >>21498643 To be honest, I never imported a template. I allways configured pins etc seperately.
    But yes, you can do it like this. And in the littlefs folder you write only
    addEventHandler OnChannelChange 2 ToggleChannel 1
    because startupcommands for drivers etc. are in the other setting section under startup_command.
    Quote:
    template (requires... so its still missing in the generated script):
    "requires autoexec.bat addEventHandler OnChannelChange 2 ToggleChannel 1"

    Quote:
    generated script (so this will be set):
    StartupCommand "backlog startdriver bl0942; powersave 1"

    hope this is right and understandable...
  • #369 21501849
    badboy3004
    Level 6  
    Hello.
    I tried it today. But it didn´t work.

    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power/get
    Info:MAIN:Time 239, idle 281103/s, free 53312, MQTT 1(1), bWifi 1, secondsWithNoPing 169, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_apparent/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_reactive/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_factor/get
    Info:MAIN:Time 240, idle 152993/s, free 53312, MQTT 1(1), bWifi 1, secondsWithNoPing 170, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.157 gate=192.168.0.1 mask=255.255.255.0 mac=38:a5:c9:f6:25:06
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-60,ssid=techniks2,bssid=48:5d:35:c9:27:d6,channel=7,cipher_type:CCMP
    Info:MAIN:Time 241, idle 197502/s, free 53312, MQTT 1(1), bWifi 1, secondsWithNoPing 171, socks 2/38 
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 7 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 16 changes count.
    Error:CMD:no file early.bat err -2
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:MAIN:Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:Using SSID [techniks2]
    Info:MAIN:Using Pass [**********]
    Info:MQTT:MQTT_RegisterCallback called for bT Licht_Wohnzimmer/ subT Licht_Wohnzimmer/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens_n/ subT bekens_n/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/Licht_Wohnzimmer/ subT cmnd/Licht_Wohnzimmer/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens_n/ subT cmnd/bekens_n/+
    Info:MQTT:MQTT_RegisterCallback called for bT Licht_Wohnzimmer/ subT Licht_Wohnzimmer/+/get
    Info:CMD:CMD_StartScript: started @startup at the beginning
    Info:EnergyMeter:Read ENERGYMETER status values. sizeof(ENERGY_METERING_DATA)=32
    Info:MAIN:Started BL0942.
    Info:CMD:CMD_PowerSave: will set to 0
    Info:CMD:CMD_StartScript: started autoexec.bat at the beginning
    Info:MAIN:Main_Init_After_Delay done
    Info:EVENT:CMD_AddEventHandler: added OnChannelChange with cmd ToggleChannel 1
    Info:MAIN:Time 1, idle 266064/s, free 79848, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 2, idle 192120/s, free 79848, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 3, idle 191253/s, free 79848, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 4, idle 191049/s, free 79848, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 5, idle 191608/s, free 79848, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Registered for wifi changes
    Info:MAIN:Connecting to SSID [techniks2]
    Info:MAIN:Time 6, idle 183236/s, free 75112, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 7, idle 179997/s, free 74416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 8, idle 82925/s, free 74544, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 9, idle 0/s, free 74544, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 10, idle 0/s, free 74544, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=38:a5:c9:f6:25:06
    Info:GEN:sta: 0, softap: 0, b/g/n


    It´s still the same behavior like just dInput.

    Info:MQTT:Publishing val 0.032 to Licht_Wohnzimmer/energycounter_today/get retain=0
    Info:MAIN:Time 197, idle 193364/s, free 53096, MQTT 1(1), bWifi 1, secondsWithNoPing 127, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/energycounter/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/energycounter_today/get
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MQTT:Publishing val 0.000 to Licht_Wohnzimmer/current/get retain=0
    Info:MQTT:Publishing val 0.00 to Licht_Wohnzimmer/power/get retain=0
    Info:MQTT:Publishing val 0.00 to Licht_Wohnzimmer/power_apparent/get retain=0
    Info:MQTT:Publishing val 0.00 to Licht_Wohnzimmer/power_reactive/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/current/get
    Info:MAIN:Time 198, idle 215916/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 128, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_apparent/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_reactive/get
    Info:MAIN:Time 199, idle 137706/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 129, socks 2/38 
    Info:MQTT:Publishing val 231.6 to Licht_Wohnzimmer/voltage/get retain=0
    Info:MAIN:Time 200, idle 191856/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 130, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/voltage/get
    Info:GEN:dhcp=0 ip=192.168.0.157 gate=192.168.0.1 mask=255.255.255.0 mac=38:a5:c9:f6:25:06
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-66,ssid=techniks2,bssid=48:5d:35:c9:27:d6,channel=7,cipher_type:CCMP
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MQTT:Publishing val 0.32 to Licht_Wohnzimmer/power_factor/get retain=0
    Info:MAIN:Time 201, idle 182487/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 131, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_factor/get
    Info:MAIN:Time 202, idle 188186/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 132, socks 2/38 
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MAIN:Time 203, idle 188857/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 133, socks 2/38 
    Info:MAIN:Time 204, idle 193521/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 134, socks 2/38 
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MQTT:Publishing val 0.232 to Licht_Wohnzimmer/current/get retain=0
    Info:MQTT:Publishing val 40.98 to Licht_Wohnzimmer/power/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/current/get
    Info:MQTT:Publishing val 53.91 to Licht_Wohnzimmer/power_apparent/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power/get
    Info:MQTT:Publishing val 35.03 to Licht_Wohnzimmer/power_reactive/get retain=0
    Info:MAIN:Time 205, idle 186166/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 135, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_apparent/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_reactive/get
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MAIN:Time 206, idle 171568/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 136, socks 2/38 
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MQTT:Publishing val Licht_Wohnzimmer to Licht_Wohnzimmer/host retain=0
    Info:MQTT:Publishing val 231.3 to Licht_Wohnzimmer/voltage/get retain=0
    Info:MQTT:Publishing val 1.00 to Licht_Wohnzimmer/power_factor/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/voltage/get
    Info:MAIN:Time 207, idle 187411/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 137, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_factor/get
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MQTT:Publishing val OpenBK7231N 1.18.66 Mar 25 2025 09:54:35 to Licht_Wohnzimmer/build retain=0
    Info:MAIN:Time 208, idle 175813/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 138, socks 2/38 
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MQTT:Publishing val 38:a5:c9:f6:25:06 to Licht_Wohnzimmer/mac retain=0
    Info:MAIN:Time 209, idle 185122/s, free 53096, MQTT 1(1), bWifi 1, secondsWithNoPing 139, socks 2/38 
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MQTT:Publishing val 54.11 to Licht_Wohnzimmer/temp retain=0
    Info:MQTT:Publishing val 0.032 to Licht_Wohnzimmer/energycounter/get retain=0
    Info:MQTT:Publishing val 0.032 to Licht_Wohnzimmer/energycounter_today/get retain=0
    Info:MAIN:Time 210, idle 188941/s, free 53048, MQTT 1(1), bWifi 1, secondsWithNoPing 140, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.157 gate=192.168.0.1 mask=255.255.255.0 mac=38:a5:c9:f6:25:06
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-65,ssid=techniks2,bssid=48:5d:35:c9:27:d6,channel=7,cipher_type:CCMP
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/energycounter/get
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/energycounter_today/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MQTT:Publishing val techniks2 to Licht_Wohnzimmer/ssid retain=0
    Info:MQTT:Publishing val 0.000 to Licht_Wohnzimmer/current/get retain=0
    Info:MQTT:Publishing val 0.00 to Licht_Wohnzimmer/power/get retain=0
    Info:MQTT:Publishing val 0.00 to Licht_Wohnzimmer/power_apparent/get retain=0
    Info:MQTT:Publishing val 0.00 to Licht_Wohnzimmer/power_reactive/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/current/get
    Info:MAIN:Time 211, idle 177301/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 141, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_apparent/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_reactive/get
    Info:MQTT:Publishing val 2 to Licht_Wohnzimmer/sockets retain=0
    Info:MAIN:Time 212, idle 178992/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 142, socks 2/38 
    Info:MQTT:Publishing val -60 to Licht_Wohnzimmer/rssi retain=0
    Info:MQTT:Publishing val 231.7 to Licht_Wohnzimmer/voltage/get retain=0
    Info:MAIN:Time 213, idle 189476/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 143, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/voltage/get
    Info:MQTT:Publishing val 213 to Licht_Wohnzimmer/uptime retain=0
    Info:MAIN:Time 214, idle 190170/s, free 53104, MQTT 1(1), bWifi 1, secondsWithNoPing 144, socks 2/38 
    Info:MQTT:Publishing val 53344 to Licht_Wohnzimmer/freeheap retain=0
    Info:MAIN:Time 215, idle 187281/s, free 53040, MQTT 1(1), bWifi 1, secondsWithNoPing 145, socks 2/38 
    Info:MQTT:Publishing val 192.168.0.157 to Licht_Wohnzimmer/ip retain=0
    Info:MAIN:Time 216, idle 193699/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 146, socks 2/38 
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MAIN:Time 217, idle 186837/s, free 53128, MQTT 1(1), bWifi 1, secondsWithNoPing 147, socks 3/38 
    Info:MAIN:Time 218, idle 189759/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 148, socks 2/38 
    Info:MAIN:Time 219, idle 188809/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 149, socks 2/38 
    Info:MAIN:Time 220, idle 193778/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 150, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.157 gate=192.168.0.1 mask=255.255.255.0 mac=38:a5:c9:f6:25:06
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-61,ssid=techniks2,bssid=48:5d:35:c9:27:d6,channel=7,cipher_type:CCMP
    Info:MAIN:Time 221, idle 186475/s, free 41648, MQTT 1(1), bWifi 1, secondsWithNoPing 151, socks 3/38 
    Info:MAIN:Time 222, idle 189713/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 152, socks 2/38 
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MQTT:Publishing val 0.008 to Licht_Wohnzimmer/current/get retain=0
    Info:MQTT:Publishing val 0.68 to Licht_Wohnzimmer/power/get retain=0
    Info:MQTT:Publishing val 2.07 to Licht_Wohnzimmer/power_apparent/get retain=0
    Info:MQTT:Publishing val 1.96 to Licht_Wohnzimmer/power_reactive/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/current/get
    Info:MQTT:Publishing val 0.33 to Licht_Wohnzimmer/power_factor/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power/get
    Info:MAIN:Time 223, idle 213689/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 153, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_apparent/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_reactive/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_factor/get
    Info:MAIN:Time 224, idle 141530/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 154, socks 2/38 
    Info:MQTT:Publishing val 231.4 to Licht_Wohnzimmer/voltage/get retain=0
    Info:MAIN:Time 225, idle 204283/s, free 44736, MQTT 1(1), bWifi 1, secondsWithNoPing 155, socks 3/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/voltage/get
    Info:GEN:23 Button_OnInitialPressDown
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MQTT:Publishing val 0 to Licht_Wohnzimmer/1/get retain=1
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/1/get
    Info:MAIN:Time 226, idle 187623/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 156, socks 2/38 
    Info:GEN:23 key_short_press
    Info:MAIN:Time 227, idle 202165/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 157, socks 2/38 
    Info:GEN:No change in channel 1 (still set to 0) - ignoring
    
    Info:MAIN:Time 228, idle 194105/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 158, socks 2/38 
    Info:MQTT:Publishing val 0.000 to Licht_Wohnzimmer/current/get retain=0
    Info:MQTT:Publishing val 0.00 to Licht_Wohnzimmer/power/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/current/get
    Info:MQTT:Publishing val 0.00 to Licht_Wohnzimmer/power_apparent/get retain=0
    Info:MQTT:Publishing val 0.00 to Licht_Wohnzimmer/power_reactive/get retain=0
    Info:MQTT:Publishing val 1.00 to Licht_Wohnzimmer/power_factor/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power/get
    Info:MAIN:Time 229, idle 217026/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 159, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_apparent/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_reactive/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/power_factor/get
    Info:MAIN:Time 230, idle 358627/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 160, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.0.157 gate=192.168.0.1 mask=255.255.255.0 mac=38:a5:c9:f6:25:06
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-60,ssid=techniks2,bssid=48:5d:35:c9:27:d6,channel=7,cipher_type:CCMP
    Info:MQTT:Publishing val 231.8 to Licht_Wohnzimmer/voltage/get retain=0
    Info:MAIN:Time 231, idle 188423/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 161, socks 2/38 
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic Licht_Wohnzimmer/voltage/get
    Info:MAIN:Time 232, idle 190146/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 162, socks 2/38 
    Info:MAIN:Time 233, idle 192239/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 163, socks 2/38 
    Info:MAIN:Time 234, idle 195805/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 164, socks 2/38 
    Info:MAIN:Time 235, idle 191594/s, free 53344, MQTT 1(1), bWifi 1, secondsWithNoPing 165, socks 2/38 
    


    Editor interface for the /autoexec.bat file showing code.
    Thanks.
  • ADVERTISEMENT
  • #371 21502251
    rufus4
    Level 10  
    >>21501849Are the channels for the pins configured like this?
      "pins": {
        "8": "LED_n;1",
        "23": "Btn;1",
        "24": "dInput_n;2",
        "26": "Rel;1"

    and littleFS like this?
    addEventHandler OnChannelChange 2 ToggleChannel 1

    Actually this works. If not, I don't know what else could be wrong in your setting.
  • #372 21502267
    p.kaczmarek2
    Moderator Smart Home
    He might have not rebooted and added the change handler twice. If added twice, the handler command will be run twice and will cancel each other...
    Helpful post? Buy me a coffee.
  • #373 21503040
    badboy3004
    Level 6  
    >>21502251
    Hello.
    Now is dInput at 2 and it seems to work. I will test it next days.

    Thank you for the support.

Topic summary

The discussion revolves around the Tuya LSPA9 smart socket, focusing on its teardown, flashing OpenBeken firmware, and configuring the BL0942 energy metering chip. Users share their experiences with various versions of the LSPA9, including issues with calibration, communication protocols (UART vs. SPI), and the stability of energy readings. Solutions include using specific commands for calibration, adjusting baud rates, and troubleshooting connectivity issues. The conversation also touches on the integration of these devices with Home Assistant and the challenges faced in ensuring accurate power measurements and MQTT communication.
Summary generated by the language model.
ADVERTISEMENT