slipx06 / sunsynk-power-flow-card

⚡A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.
MIT License
161 stars 48 forks source link

Off Grid Icon #478

Closed bazcurtis closed 3 weeks ago

bazcurtis commented 3 weeks ago

Is there an existing issue for this?

Current Behavior

It shares the export_icon: mdi:transmission-tower-export icon

Expected behaviour

I would like it to use mdi:transmission-tower-off

Possible Solutions

Add an off_grid_icon option. I thought the disconnected_icon would provide this option

Mode

Both

Context / Reason

I think that would cover all options.

slipx06 commented 3 weeks ago

Hi. That icon will only display when your grid power = 0 and and the grid_connected_status_194: is reporting the correct grid disconnected state

image

let customGridIcon: string;
        let customGridIconColour: string;
        switch (true) {
            case totalGridPower < 0 && validGridConnected.includes(gridStatus.toLowerCase()):
                customGridIcon = iconGridExport;
                customGridIconColour = gridColour;
                break;
            case totalGridPower >= 0 && validGridConnected.includes(gridStatus.toLowerCase()):
                customGridIcon = iconGridImport;
                customGridIconColour = gridColour;
                break;
            case totalGridPower === 0 && validGridDisconnected.includes(gridStatus.toLowerCase()):
                customGridIcon = iconGridDisconnected;
                customGridIconColour = gridOffColour;
                break;
            default:
                customGridIcon = iconGridImport;
                customGridIconColour = gridColour;
                break;
        }
bazcurtis commented 3 weeks ago

Thanks, I will look into that. I have a binary sensor that I made already. I assume 0 watts was enough. I did not have 194 in my config. I will have to wait until tonight to test it.

slipx06 commented 3 weeks ago

The reason it's needed because you can still have your grid connected but you are just not drawing any power.

bazcurtis commented 3 weeks ago

It is working fine now. Thanks for the help.