Page 1 of 1
mydomoticz alternative??
Posted: Thursday 18 January 2018 16:26
by beounet
Hi guys!!
I was wonder if it might be possible to use (or make) an alternative proxy application like mydomoticz!
Thanks in advance and sorry for my possible ignorance about proxy staff
Re: mydomoticz alternative??
Posted: Friday 19 January 2018 11:40
by blauwebuis
I've never used myDomoticz. But I plan to create this:
- Send a codeword SMS to Domoticz (via MySensors)
- Domoticz enables the internet connection between the private network and the wider internet
- Domoticz calls the script below on my public server, telling me what it's IP address is.
- I log into domoticz/my network from outside.
- After an X amount of time the internet is disconnected again.
The simple PHP script:
- call yourdomain/folder/save.php from Domoticz to reveal the IP address.
- visit yourdomain/folder/index.html to see what the IP address is.
<html>
<head>
<title>what is my ip</title>
</head>
<body>
This page should only be called by Domoticz, so that it will store its IP address.
Just visit index.html in this folder to see the IP address of Domoticz.
<?PHP
function getUserIP()
{
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = $_SERVER['REMOTE_ADDR'];
if(filter_var($client, FILTER_VALIDATE_IP))
{
$ip = $client;
}
elseif(filter_var($forward, FILTER_VALIDATE_IP))
{
$ip = $forward;
}
else
{
$ip = $remote;
}
return $ip;
}
$user_ip = "Domoticz is at" . getUserIP();
echo $user_ip; // Output IP address [Ex: 177.87.193.134]
//file_put_contents("index.html",$user_ip,FILE_APPEND);
file_put_contents("index.html",$user_ip);
?>
</body>
</html>
Re: mydomoticz alternative??
Posted: Sunday 21 January 2018 9:37
by gerardosamara
Another possible solution would be to create a remote login portal , if you have a paid web hosting service like hostinger.com or a free web hosting service like 000webhost.com for example.
The login portal will call domoticz
Re: mydomoticz alternative??
Posted: Sunday 21 January 2018 9:57
by zicht
thinking out loud :
And what about security ?
Online systems are vulnerable and from high value in some circuits.
So any central system is to be expected to get interest from people that are not automation oriented.
A simple redirect based on a detected ip will never be clever in my opinion.
Re: mydomoticz alternative??
Posted: Tuesday 20 February 2018 18:58
by EdddieN
I do not know much about this but what about a MQTT on a server and a remote request for a r-ssh?
Cloud <-> MQTT <-> Domoticz
Request from the cloud to Domoticz to open a r-ssh
I agree an open port to the external world is not nice... but sometimes is the only way.
Re: mydomoticz alternative??
Posted: Tuesday 20 February 2018 19:03
by Hobbybob
I installed pivpn and connect to my network through that.
Re: mydomoticz alternative??
Posted: Tuesday 20 February 2018 19:06
by EdddieN
Interesting, so you connect to the Pi from outside by logging into the VPN?
Re: mydomoticz alternative??
Posted: Tuesday 20 February 2018 19:09
by Hobbybob
Yes, you can use the official openVPN app on your smartphone.
You have to install it (see
www.pivpn.io), and forward one port in your router to the pi. Then you can connect to it, and your internettraffic gets router through your home-network, which means you can control domoticz as if you were at home (webbased interface, domoticz-app, whatever).
Re: mydomoticz alternative??
Posted: Wednesday 28 February 2018 17:41
by EdddieN
Re: mydomoticz alternative??
Posted: Wednesday 28 February 2018 18:09
by SweetPants
Hobbybob wrote: ↑Tuesday 20 February 2018 19:09
Yes, you can use the official openVPN app on your smartphone.
You have to install it (see
www.pivpn.io), and forward one port in your router to the pi. Then you can connect to it, and your internettraffic gets router through your home-network, which means you can control domoticz as if you were at home (webbased interface, domoticz-app, whatever).
I use OpenVPN too with some certificates and it works great both From my laptop and Android Phone (using Domoticz App). Only need to open one port on my firewall (and that is not the default 1194)
Re: mydomoticz alternative??
Posted: Wednesday 28 February 2018 18:19
by EdddieN
Out of curiosity, does anyone know the architecture of myDomoticz? Is it a reverse proxy as well?
Re: mydomoticz alternative??
Posted: Wednesday 28 February 2018 19:33
by EdwinK
Hobbybob wrote: ↑Tuesday 20 February 2018 19:09
Yes, you can use the official openVPN app on your smartphone.
You have to install it (see
www.pivpn.io), and forward one port in your router to the pi. Then you can connect to it, and your internettraffic gets router through your home-network, which means you can control domoticz as if you were at home (webbased interface, domoticz-app, whatever).
n ever got that to work

Re: mydomoticz alternative??
Posted: Wednesday 28 February 2018 20:10
by SweetPants
EdwinK wrote: ↑Wednesday 28 February 2018 19:33
n ever got that to work
There are several tutorials on the internet you can use. I terminate the tunnel on a Raspberry PI3 used as an Internet router with iptables firewall. My GUI firewall frontend is FW Builder.