5 Wifi in home and notifiction in tts

Tags: #<Tag:0x00007f739b3be960> #<Tag:0x00007f739b3be668>

Hi, I have a question, it is a bit difficult for me to write in a foreign language, I was looking for a solution in the forum, but I did not find it. Well, I have 5 Wifi routers at home (old house - fat walls) and I would like to hear tts voice notification on a given speaker depending on which wifi I am logged in to. Can you tell me how to do it? Initially, I did something like this, but I don’t know how to bite it further. In addition, it would be nice to include for a given person.
Outside, I just want only phone notifications
summarizing:
3 persons
5 wifi in the house (routers)
3 speakers (2 google and 1 chromecast)
The first wifi is outside work
I was thinking about something like this

[
    {
        "id": "c78a7198.6c206",
        "type": "switch",
        "z": "9577df01.cf1f68",
        "name": "wifi Connection?",
        "property": "payloadx",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "<not connected>",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Bestconnect.pl_606794978",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Bestconnect.pl_606794978 - 5G",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Gosc_2,4Ghz",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Sonoff_1",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Sonoff_2",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Balkon_cwik",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Garaż_Cwik",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Warsztat",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Sonoff_3",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": true,
        "outputs": 10,
        "x": 440,
        "y": 220,
        "wires": [
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            []
        ]
    },
    {
        "id": "bd623ae2.df6f68",
        "type": "api-current-state",
        "z": "9577df01.cf1f68",
        "name": "Marzena wifi",
        "server": "19ddd6a6.ef9d89",
        "version": 1,
        "outputs": 1,
        "halt_if": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "override_topic": false,
        "entity_id": "sensor.mi_max_3_wifi_connection",
        "state_type": "str",
        "state_location": "payloadx",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "blockInputOverrides": false,
        "x": 250,
        "y": 220,
        "wires": [
            [
                "c78a7198.6c206"
            ]
        ]
    },
    {
        "id": "9efe5160.5e182",
        "type": "api-current-state",
        "z": "9577df01.cf1f68",
        "name": "Łukasz wifi",
        "server": "19ddd6a6.ef9d89",
        "version": 1,
        "outputs": 1,
        "halt_if": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "override_topic": false,
        "entity_id": "sensor.mi_max_3_wifi_connection",
        "state_type": "str",
        "state_location": "payloadx",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "blockInputOverrides": false,
        "x": 250,
        "y": 180,
        "wires": [
            [
                "c78a7198.6c206"
            ]
        ]
    },
    {
        "id": "32ef0ec9.5cb88a",
        "type": "api-current-state",
        "z": "9577df01.cf1f68",
        "name": "Amela wifi",
        "server": "19ddd6a6.ef9d89",
        "version": 1,
        "outputs": 1,
        "halt_if": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "override_topic": false,
        "entity_id": "sensor.redmi_5a_wifi_connection",
        "state_type": "str",
        "state_location": "payloadx",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "blockInputOverrides": false,
        "x": 240,
        "y": 260,
        "wires": [
            [
                "c78a7198.6c206"
            ]
        ]
    },
    {
        "id": "19ddd6a6.ef9d89",
        "type": "server",
        "z": "",
        "name": "Home Assistant",
        "addon": true
    }
]

So… Why do you have different networks?
Why not just make them all one network? Or is there a reason why you don’t want a network like a… hotel has for example.
You log in to “SSID hotel” and you can move around through 10 floors and still be on the same network and don’t have to switch SSID.

What I’m asking really, is there a reason to have different SSIDs?

Regarding your actual question. Do you have the companion app installed? It will give you the SSID you are connected too and can be used for this flow.

I have installed the application on the phone - home assistant, and the system sees what network I am in. I want to redirect it so that the speakers speak to me only in the room where I stay, because I don’t need information to irritate other household members

I just corrected the post to make it more readable - the code also

I’m not sure I understand what is not working.
I just tested to replicate what you have and I get the name of the wifi from the current state node and it’s passed to the switch node that can switch between the wifi’s if you have that.
So… What is missing?

So the problem is with message duplication
when we are all in the same network, the same message will go to the speaker at least 3 times at the same time
also this problem is with phone notifications, information is also duplicated (2 information), although only I am outside the network and other people are in the home network
Below is an example of application with notification on the phone - here I am duplicating a message

[
    {
        "id": "9577df01.cf1f68",
        "type": "subflow",
        "name": "Jakie wifi - forum",
        "info": "",
        "category": "",
        "in": [
            {
                "x": 60,
                "y": 220,
                "wires": [
                    {
                        "id": "9efe5160.5e182"
                    },
                    {
                        "id": "bd623ae2.df6f68"
                    },
                    {
                        "id": "32ef0ec9.5cb88a"
                    }
                ]
            }
        ],
        "out": [
            {
                "x": 640,
                "y": 100,
                "wires": [
                    {
                        "id": "c78a7198.6c206",
                        "port": 0
                    }
                ]
            },
            {
                "x": 640,
                "y": 160,
                "wires": [
                    {
                        "id": "c78a7198.6c206",
                        "port": 1
                    },
                    {
                        "id": "c78a7198.6c206",
                        "port": 2
                    },
                    {
                        "id": "c78a7198.6c206",
                        "port": 3
                    },
                    {
                        "id": "c78a7198.6c206",
                        "port": 4
                    }
                ]
            },
            {
                "x": 640,
                "y": 220,
                "wires": [
                    {
                        "id": "c78a7198.6c206",
                        "port": 5
                    }
                ]
            },
            {
                "x": 640,
                "y": 280,
                "wires": [
                    {
                        "id": "c78a7198.6c206",
                        "port": 6
                    },
                    {
                        "id": "c78a7198.6c206",
                        "port": 7
                    }
                ]
            },
            {
                "x": 640,
                "y": 340,
                "wires": [
                    {
                        "id": "c78a7198.6c206",
                        "port": 8
                    },
                    {
                        "id": "c78a7198.6c206",
                        "port": 9
                    }
                ]
            }
        ],
        "env": [],
        "color": "#DDAA99"
    },
    {
        "id": "c78a7198.6c206",
        "type": "switch",
        "z": "9577df01.cf1f68",
        "name": "wifi Connection?",
        "property": "payloadx",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "<not connected>",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Bestconnect.pl_606794978",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Bestconnect.pl_606794978 - 5G",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Gosc_2,4Ghz",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Sonoff_1",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Sonoff_2",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Balkon_cwik",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Garaż_Cwik",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Warsztat",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Sonoff_3",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": true,
        "outputs": 10,
        "x": 440,
        "y": 220,
        "wires": [
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            []
        ]
    },
    {
        "id": "bd623ae2.df6f68",
        "type": "api-current-state",
        "z": "9577df01.cf1f68",
        "name": "Marzena wifi",
        "server": "19ddd6a6.ef9d89",
        "version": 1,
        "outputs": 1,
        "halt_if": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "override_topic": false,
        "entity_id": "sensor.mi_max_3_wifi_connection",
        "state_type": "str",
        "state_location": "payloadx",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "blockInputOverrides": false,
        "x": 250,
        "y": 220,
        "wires": [
            [
                "c78a7198.6c206"
            ]
        ]
    },
    {
        "id": "9efe5160.5e182",
        "type": "api-current-state",
        "z": "9577df01.cf1f68",
        "name": "Łukasz wifi",
        "server": "19ddd6a6.ef9d89",
        "version": 1,
        "outputs": 1,
        "halt_if": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "override_topic": false,
        "entity_id": "sensor.mi_max_3_wifi_connection",
        "state_type": "str",
        "state_location": "payloadx",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "blockInputOverrides": false,
        "x": 250,
        "y": 180,
        "wires": [
            [
                "c78a7198.6c206"
            ]
        ]
    },
    {
        "id": "32ef0ec9.5cb88a",
        "type": "api-current-state",
        "z": "9577df01.cf1f68",
        "name": "Amela wifi",
        "server": "19ddd6a6.ef9d89",
        "version": 1,
        "outputs": 1,
        "halt_if": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "override_topic": false,
        "entity_id": "sensor.redmi_5a_wifi_connection",
        "state_type": "str",
        "state_location": "payloadx",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "blockInputOverrides": false,
        "x": 240,
        "y": 260,
        "wires": [
            [
                "c78a7198.6c206"
            ]
        ]
    },
    {
        "id": "177861eb.1f517e",
        "type": "server-state-changed",
        "z": "599eaf48.dc5ec8",
        "name": "Lodówka",
        "server": "19ddd6a6.ef9d89",
        "version": 1,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "binary_sensor.czujnik_drzwi_5",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "x": 140,
        "y": 1000,
        "wires": [
            [
                "36f48577.aa652a",
                "e32b5640.6a7d88"
            ],
            []
        ]
    },
    {
        "id": "e32b5640.6a7d88",
        "type": "function",
        "z": "599eaf48.dc5ec8",
        "name": "Wiadomość",
        "func": "msg.payload=\n{\n    \"data\":\n    {\n    \"message\": \"Lodówka otwarta.\",\n    }\n}\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 610,
        "y": 1000,
        "wires": [
            [
                "b66bb348.f7f7b",
                "d4021bcf.9a54f8"
            ]
        ]
    },
    {
        "id": "d4021bcf.9a54f8",
        "type": "subflow:9577df01.cf1f68",
        "z": "599eaf48.dc5ec8",
        "name": "",
        "x": 820,
        "y": 1000,
        "wires": [
            [
                "6eaf3936.8a39d8"
            ],
            [],
            [],
            [],
            []
        ]
    },
    {
        "id": "6eaf3936.8a39d8",
        "type": "api-call-service",
        "z": "599eaf48.dc5ec8",
        "name": "Powiadomienie Łukasz",
        "server": "19ddd6a6.ef9d89",
        "version": 1,
        "debugenabled": true,
        "service_domain": "notify",
        "service": "mobile_app_mi_max_3",
        "entityId": "",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "payload",
        "output_location_type": "msg",
        "mustacheAltTags": false,
        "x": 1020,
        "y": 1000,
        "wires": [
            []
        ]
    },
    {
        "id": "19ddd6a6.ef9d89",
        "type": "server",
        "z": "",
        "name": "Home Assistant",
        "addon": true
    }
]

hallo, any idea?