Category: Technology

Technical Writings; Information and Communication Technology Posts

Freedom to do evil?

One of the key paradoxes about freedom is the freedom to do both right and wrong.  We balance freedom with laws that restrict certain freedoms by providing limits on what society regards as acceptable.  In a completely open model, those freedoms can be used for both good and evil.  Despite being of a liberal mindset, I also understand that we must take responsibility for our own actions, which may mean balancing our own freedoms against our responsibilities to our fellow man.

With the announcement today that Facebook, Google & Microsoft are teaming up to block extremist content on the internet, should we be concerned that such technology could also be used to restrict access to any content?  If Donald Trump doesn’t like a particular news article about him, can he get it blocked?

One of the most clearly concerning episodes from the recent US election is that conversation is being channeled into separate media – rather than having a balanced debate on a platform, echo chambers on both sides of the argument are being setup to polarise opinion.  Twitter is blocking the ‘alt-right’ and fascist behaviours, only for that community to move over to a new platform, gab.ai.  The liberal left are unlikely to want to join the platform, so the problem is exacerbated.

Does ‘Freedom of speech’ on the internet require a new paradigm?  Whilst media censorship has been an accepted means of protecting the liberty of groups and individuals in protecting against vile, fascist and immoral diatribes from groups that make the majority of us uncomfortable – does the communication revolution of the internet mean that we can no longer use these old methods to protect our citizenry?

I’m unclear as to whether there’s an answer, or whether the answer is unacceptable to our traditional values.  We cannot create a ‘clean’ internet without gagging certain views, and in doing so we’re giving the control to whom?  The technology companies are immature as far as moral and ethical codes go, so maybe we need to lean on other organisations that have more experience in ethical/moral frameworks to help shape the better model of intervention?

Mutable Blockchains? (Oxymoronic)

Exactly where does a mutable blockchain fit in the financial ecosystem?

I’m intrigued to see the use case, due to be announced by Accenture tomorrow, that would mean that a mutable ‘Blockchain’ within a private permissioned system is anything but.

Of course, I could be wrong – but this does seem a strange interpretation of Blockchain as used for financial institutions. Part of the beauty is being able to track back through transaction history to see what actually happened. See – I’m not saying that fat-finger trading doesn’t happen – but by admitting it does happen and recording the reversal in a later block you end up with more transparency in the process.

Source: http://www.ft.com/cms/s/0/f5cd6754-7e83-11e6-8e50-8ec15fb462f4.html?siteedition=uk#axzz4KjPI905k

Gnu-style tooling on Ethereum Smart Contracts

The Ethereum project‘s fundamental goal of providing a distributed computing system, paid for using the cryptocurrency generated by the computations on the platform is a really interesting concept.

Smart contracts, however, have some key limitations, one of which was demonstrated by the attack on the DAO.

I anticipate in the future that we’ll end up with smart contracts that are congruent with gnu tools.  Where we currently manage a project by holding a hash of the tool available for download on a trusted resource (the organisation’s website) – we could then develop these single purpose tools as smart contracts.  Organisations themselves could be defined in a smart contract, and that contract would maintain a version history of ‘approved smart contracts.’

To this end, you could then ‘safely’ chain smart contracts together in an ecosystem similar to the original gnu utils.

I’m sure the economics of ethereum don’t enable this to be economically viable on the public live network, but it’d be interesting to see how far away the Ethereum project is from this becoming a reality.

Be interesting to know your thoughts.

Heatmiser Component

Now I’ve got the heatmiser component working with home-assistant, I want to ready a v2 release which will enable it to also work with other devices other than just heatmiser thermostats.

There are two categories of component:

  1. Master – the UH1 device, which is the serial interface from the home-automation system to the thermostats.
  2. Slave – currently just the thermostats, but will also be timing switches, humidity sensors .etc

Currently the system is setup as below in heatmiser.py, with the interface to the serial port set in the setup_platform() method of the heatmiser interface:

Screen Shot 2015-12-16 at 11.10.50

As you can see, I’ve left the hot water out.  Because the serial port is held open my heatmiser.py there’s likely to be a contention issue.

What I’d like to do is split the UH1 serial port out into a separate component, that opens up the serial port and makes it available to other components, I’d then set the UH1 component as a dependency of heatmiser.py.  I could then create a switch device for heatmiserHW.py to control the TM1 timing box.  This solution would look more like:

Screen Shot 2015-12-16 at 11.10.59

The final option is that I simply add the hotwater device as part of the heatmiser component, – i.e. create a new class for TM1 in heatmiser.py that doesn’t have the Thermostat base class, but one of a switch.  The thing stopping me from picking this option is the folder structure.  heatmiser.py currently lives in components/thermostats/ – and if I were to add a switch class in here it could start getting messy.

Advice please 🙂

Python testing

I recently produced a new python module for interacting with heatmiser thermostats using version 3 of their protocol.  I have it setup on github, and have started writing some unit tests to make sure I don’t break it, as it’s now a dependency of the wonderful https://home-assistant.io.

My main concern is that the module currently only works on python3 due to the datatype differences in the pyserial module.  Essentially in the python2 code, it’s possible to pass a string of bytes to the pyserial serial.write() command, but in python3 you need to prepare a bytes datatype to pass to the module.

I want to capture this in my tests, rather than just write an if/else based on the version of python being used.  If you can make any recommendations on how best I achieve this, it would be much appreciated.

Python to the rescue for home automation

Those of you who’ve read my most recent ramblings will have come across the work I’ve been doing to try and get my home Control4 automation system connected up with my hot water timing switch.  It’s been nice to hack around with a new language, and also to better understand the low-level bit-level operations that are required to interface with the thermostats and timers.  What hasn’t been nice is the wall of silence from Control4 on offering assistance, despite the fact that I expect my work to add value to their product.

To take a step back and look at the wider home-automation environment would begin to give some clue as to the state of affairs.  Home automation is the realm of the wealthy or the geeky – as up until relatively recently each environment has required fairly time-intensive and bespoke programming.  Control4 has a whole market built up around providing this bespoke service, so to start to allow geeks to work on their products for free has the potential to undercut their partner network.

Instead of focusing on ‘whole house’ automation, new companies have come into the market by offering automation of a ‘single’ element of your home.  Nest for heating, Hue for lighting .etc  The challenge here is that each of the elements are operating in their own silo.  Automation isn’t about just having things connected, it’s about intelligent connections and the concept of pre-programmed or dynamic ‘scenes’ – that’ll set all the devices based on some kind of intelligence.

Home-assistant.io

Taking these new silo’d modules and fitting them into an overall solution is https://home-assistant.io/.  The beauty of the architecture is that each of the modules is not only being kept completely independent, but rather than producing specific modules for the platform, it leverages the pre-existing python modules.  Of course, there’s a little bit of interface code to import the module and expose the right values to the system – but it’s limited to purely an interface.  The beauty is that there are already a load of python libraries out there, and even last week I was able to both convert some pre-existing python scripts into a heatmiserV3 module, to then integrate with home assistant.

The other advantage of home-assistant that I’m starting to consider is the ability for the system itself to be ‘cloud’ based, rather than hosted at home.  For many of the modules, this system is a true ‘internet of things’ – as everything is web-connected.  Unfortunately, my heatmiser serial communication requires a local network connection (and isn’t encrypted/protected, so wouldn’t be straightforward to open up to the internet) – so it’s more an ‘intranet of things’.

Either way, it’s an exciting evolution of home-automation software.  In a not dissimilar way to IFTTT.com, I expect ‘recipes’ with pre-configured relationships between two devices will start to propagate – and hopefully more people can get the financial and energy benefits of the new wave of home automation.