File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 100100 el . css ( { display : '' } ) ;
101101 if ( data . pumpOnDelay === true )
102102 el . find ( 'div.picIndicator' ) . attr ( 'data-status' , 'delay' ) ;
103- else
104- el . find ( 'div.picIndicator' ) . attr ( 'data-status' , data . command === 10 || data . relay > 0 ? 'on' : 'off' ) ;
103+ else {
104+ // Determine pump on/off status based on pump type
105+ var isOn = false ;
106+ if ( type . name === 'regalmodbus' || type . name === 'regalmodbus2' ) {
107+ // For modbus pumps, use actual speed/flow indicators
108+ // Pump is considered "on" if it's actually running at a speed > 0
109+ isOn = ( typeof data . rpm !== 'undefined' && data . rpm > 0 ) ||
110+ ( typeof data . speed !== 'undefined' && data . speed > 0 ) ;
111+ if ( data . id === 1 ) { // Debug for pump 1 only to avoid spam
112+ console . debug ( `[Pump ${ data . id } ] Modbus pump state - rpm: ${ data . rpm } , speed: ${ data . speed } , isOn: ${ isOn } ` ) ;
113+ }
114+ }
115+ else {
116+ // For relay-based pumps, use command or relay status
117+ isOn = data . command === 10 || data . relay > 0 ;
118+ }
119+ el . find ( 'div.picIndicator' ) . attr ( 'data-status' , isOn ? 'on' : 'off' ) ;
120+ }
105121 }
106122 el . attr ( 'data-pumptype' , data . type . val ) ;
107123 el . attr ( 'data-id' , data . id ) ;
You can’t perform that action at this time.
0 commit comments