companion icon indicating copy to clipboard operation
companion copied to clipboard

Internal variable to show actual ip(s)

Open hsteppke opened this issue 6 years ago • 5 comments

Feature Request to get an internal variable, to be displayed on a button, like internal:bind_ip but based on the real IP at a given time. (not the config value which is 0.0.0.0 on the pi)

I want my raspberry when it starts with and old config and the Stream deck is attached to it it could show the IP...

This request is very unimportant as i use Static IPs most of the time but think its is maybe usefull if people use DHCP.

hsteppke avatar Feb 16 '20 20:02 hsteppke

Relates to #539

josephdadams avatar Feb 17 '20 13:02 josephdadams

I see, relates but is much different i belive in complexity. The other request talks about change the bindings to different IPs for modules.

This one is only to expose the IP the server_http for the GUI currently binds to as a variable. So i (without understanding all the details of the different modules) would place a variable push where the server actually rebinds. Or if i read correctly in the bitfocus-companion/index.js there is also a callback for ip_rebindings, if the IP is available there it would be optimal to push it there. I even think in a none PIP headless world that would actual happen as the config IP is the actually IP but for headless it is 0.0.0.0 and thats what is pushed once to the variables.

hsteppke avatar Feb 17 '20 14:02 hsteppke

I have added a first_ip and an all_ip as variable in the latest build. The first variable is the one returned first from getting all interfaces, which should be the priority 1 interface. If its the wrong one you could check the others.

JeffreyDavidsz avatar Feb 29 '20 09:02 JeffreyDavidsz

Just adding a comment here in case anyone stumbles across it. In the current build (2.0.0 (62b280c-2271)), the variable for returning IP address for specific interfaces is: eth0 -> $(internal:eth0) bind -> $(internal:bind_ip) (useless when using CompanionPi all IP -> $(internal:all_ip)

@JeffreyDavidsz Do you think it would be helpful to have a running list of internal variables somewhere? Maybe in the wiki but also somewhere in the Companion web interface? Or am I late to the party and that already exists somewhere?

moofur avatar Apr 05 '20 15:04 moofur

Whel when you type $( you'll get all the variables. At the moment all interfaces your system has are in that list.

JeffreyDavidsz avatar Apr 05 '20 17:04 JeffreyDavidsz