|
From: Dave N. <da...@ne...> - 2025-04-22 21:41:09
|
I suspect state_now is firing, but your if will return false since
state_now returns the state which is 0....
On Tue, Apr 22, 2025, 5:02 PM Brian Rudy via misterhouse-users <
mis...@li...> wrote:
> Hi folks,
>
> I have run into a weird issue with an mqtt_Item which, when changed,
> returns a raw value of 0 or 1 but only fires state_now and state_changed if
> the value is 1. However, in the object log I can see that the state is
> actually changing between 0 and 1.
> Code snippet:
> *$outer_front_lawn_person_status = new mqtt_Item($mqtt1,
> "frigate/Front_Lawn/person");*
> *if (my $state = state_now $outer_front_lawn_person_status) {*
> * print_log "[Frigate Front Lawn Person]: Status changed $state";*
> *}*
>
>
> With mqtt debug enabled, I see the following in the logs:
>
>
>
>
>
> *04/22/2025 10:55:35 [MQTT D1]: mqtt Rcv'd: R:0
> T:'frigate/Front_Lawn/person' M:'0' 04/22/2025 10:55:35 [MQTT D1]:
> mqtt_Item nom to MQTT to MH $outer_front_lawn_person_status::set(0,
> mqtt=HASH(0x5a0323b77138)) ... 04/22/2025 11:42:12 [MQTT D1]: mqtt Rcv'd:
> R:0 T:'frigate/Front_Lawn/person' M:'1' 04/22/2025 11:42:12 [MQTT D1]:
> mqtt_Item nom to MQTT to MH $outer_front_lawn_person_status::set(1,
> mqtt=HASH(0x5a0323b77138)) 04/22/2025 11:42:12 [Frigate Front Lawn
> Person]: Status changed 1*
>
>
> In the object logs for *$outer_front_lawn_person_status* I have:
> *04/22/2025 11:42:12 1*
> *04/22/2025 10:55:35 0*
>
>
> Has anyone run into this before, and if so, how did you work around it?
>
>
> Cheers!
> -Brian
> ________________________________________________________
> To unsubscribe from this list, go to:
> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>
>
|